Skip to content

An AI-powered command-line tool for managing sessions, commands, and todos. Automate workflows, track tasks, and execute saved commands with ease.

License

Notifications You must be signed in to change notification settings

cshaiku/craifter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Craifter

License: MIT

A command-line tool for managing sessions, commands, and todos. Designed to organize workflows, track tasks, and execute saved commands.

Table of Contents

Purpose

Craifter empowers users to create, manage, and automate command-line tasks through organized "sessions." It combines task tracking (todos) with executable command storage, enabling efficient workflow automation for developers, sysadmins, and productivity enthusiasts.

Reasoning

This project was created to address the need for deeper automation of AI-assisted tasks on the command line. While AI systems like Grok can generate commands and ideas, executing and organizing them into reusable workflows often requires manual effort. Craifter provides a structured way to save, track, and replay commands generated by AI, reducing repetitive work and enhancing productivity. It evolved from a desire to make AI-generated scripts persistent and executable, turning one-off suggestions into automated sessions.

Features

  • Session Management: Create and organize projects with persistent storage.
  • Command Execution: Save and run shell commands within sessions.
  • Todo Tracking: Manage tasks with priorities and statuses.
  • Playback & Automation: Review and execute saved workflows.
  • Command-Line Interface: Full CLI support with interactive and direct modes.
  • Persistence: Sessions and commands saved to disk for reuse.

Installation

Prerequisites

  • C++17 compatible compiler (e.g., g++ 7+, clang 5+, MSVC 2017+)
  • CMake (optional, for build systems)
  • Standard library with filesystem support

Linux

Debian/Ubuntu (x86_64)

sudo apt update
sudo apt install g++ make
git clone https://github.com/[your-username]/craifter.git
cd craifter
g++ -std=c++17 -o craifter main.cpp
sudo mv craifter /usr/bin/craifter
mkdir -p /root/craifter/sessions

Fedora/CentOS/RHEL (x86_64)

sudo dnf install gcc-c++ make  # or yum for older
git clone https://github.com/[your-username]/craifter.git
cd craifter
g++ -std=c++17 -o craifter main.cpp
sudo mv craifter /usr/bin/craifter
mkdir -p /root/craifter/sessions

Arch Linux (x86_64)

sudo pacman -S gcc make
git clone https://github.com/[your-username]/craifter.git
cd craifter
g++ -std=c++17 -o craifter main.cpp
sudo mv craifter /usr/bin/craifter
mkdir -p /root/craifter/sessions

ARM (e.g., Raspberry Pi, ARM64)

# Install compiler (same as above for your distro)
# For cross-compilation if needed: sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
git clone https://github.com/[your-username]/craifter.git
cd craifter
g++ -std=c++17 -o craifter main.cpp  # Or use aarch64-linux-gnu-g++ for cross
sudo mv craifter /usr/bin/craifter
mkdir -p /root/craifter/sessions

Windows

Using MinGW (GCC)

  1. Install MinGW-w64: Download from https://www.mingw-w64.org/ or use MSYS2.
  2. Open MinGW terminal.
git clone https://github.com/[your-username]/craifter.git
cd craifter
g++ -std=c++17 -o craifter.exe main.cpp
# Move to PATH, e.g., C:\Windows\System32\craifter.exe
# Create sessions dir: mkdir C:\Users\YourUser\craifter\sessions

Using Visual Studio

  1. Install Visual Studio with C++ support.
  2. Open Developer Command Prompt.
git clone https://github.com/[your-username]/craifter.git
cd craifter
cl /std:c++17 main.cpp /Fe:craifter.exe
# Move to PATH
# Create sessions dir as above

macOS

Using Xcode Command Line Tools

xcode-select --install  # Install command line tools
git clone https://github.com/[your-username]/craifter.git
cd craifter
clang++ -std=c++17 -o craifter main.cpp
sudo mv craifter /usr/local/bin/craifter
mkdir -p /Users/youruser/craifter/sessions  # Adjust path in code if needed

Using Homebrew

brew install gcc
git clone https://github.com/[your-username]/craifter.git
cd craifter
g++-11 -std=c++17 -o craifter main.cpp  # Use installed gcc
sudo mv craifter /usr/local/bin/craifter
mkdir -p /Users/youruser/craifter/sessions

Generic/Unknown OS

  1. Ensure a C++17 compiler is installed (check with g++ --version or equivalent).
  2. Clone: git clone https://github.com/[your-username]/craifter.git
  3. Compile: g++ -std=c++17 -o craifter main.cpp (replace g++ with your compiler, e.g., clang++)
  4. Move binary to a directory in your PATH (e.g., /usr/local/bin/ on Unix-like, or add to PATH on Windows).
  5. Create sessions directory: mkdir -p /path/to/craifter/sessions and update the path in main.cpp if needed.
  6. If filesystem library issues, ensure your compiler/standard library supports <filesystem> (e.g., link with -lstdc++fs on older GCC).

Usage

Run Craifter interactively: craifter Or use command-line arguments: craifter [--sessions-dir <path>] <command>

Configuration

  • Default Sessions Directory: ~/.craifter/sessions
  • Config File: ~/.craifter/config with sessions_dir=/path/to/sessions
  • Command-Line Flag: --sessions-dir /path/to/sessions (overrides config)
  • Priority: Flag > Config > Default

Examples

Basic Todo Management

craifter addtodo fix_bug "Fix login issue" high
craifter showtodos
craifter updatetodo fix_bug completed

Session and Command Management

craifter newsession deploy_app
craifter savecommand deploy_app "git add ."
craifter savecommand deploy_app "git commit -m 'Auto-commit'"
craifter savecommand deploy_app "git push origin main"
craifter savenote deploy_app "Deployment workflow for app updates"
craifter playback deploy_app  # View saved commands and notes
craifter runproject deploy_app  # Execute the commands

Listing and Managing Sessions

craifter listsessions
craifter newsession new_project

Help Command

Run craifter help for a detailed command reference:

Craifter - Session and Task Management Tool
Purpose: Manage tasks, sessions, and commands with persistence and execution.
Commands:
  addtodo <id> <task> [priority]  - Add a new todo item. Priority: low/medium/high (default: medium).
                                  Purpose: Track individual tasks. Example: craifter addtodo fix_bug 'Fix login issue' high
  updatetodo <id> <status>        - Update a todo's status. Status: pending/in_progress/completed.
                                  Purpose: Mark task progress. Example: craifter updatetodo fix_bug completed
  showtodos                      - Display all current todos.
                                  Purpose: Review pending/in-progress tasks. Example: craifter showtodos
  newsession <name>              - Create a new session (project) for organizing commands and notes.
                                  Purpose: Start a new workflow container. Example: craifter newsession web_deployment
  savecommand <session> <cmd>    - Save a command to a session for later execution.
                                  Purpose: Store repeatable actions. Example: craifter savecommand web_deployment 'git push origin main'
  savenote <session> <note>      - Save a note or description to a session.
                                  Purpose: Add context or documentation. Example: craifter savenote web_deployment 'Deploy to production server'
  playback <session>             - Display saved commands and notes for a session.
                                  Purpose: Review session contents. Example: craifter playback web_deployment
  listsessions                   - List all available sessions.
                                  Purpose: See active projects. Example: craifter listsessions
  runproject <session>           - Execute saved commands for a session (with playback).
                                  Purpose: Automate session tasks. Example: craifter runproject web_deployment
  exit                           - Exit the interactive mode.
                                  Purpose: Close the tool. Example: craifter exit
Usage: craifter <command> or run interactively.

Contributing

Contributions are welcome! Please fork the repo, make changes, and submit a pull request. For major features, open an issue first.

Disclaimer

This software is provided "as is" without warranty of any kind, express or implied. The authors are not liable for any damages, losses, or issues arising from its use, including but not limited to data loss, system failures, or any other consequences.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An AI-powered command-line tool for managing sessions, commands, and todos. Automate workflows, track tasks, and execute saved commands with ease.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages