Skip to content

Repository files navigation

CraftedCode

Native AI coding terminal — by Seyhun Akyurek

Note: CraftedCode is in early development. APIs and features may change. Contributions welcome — open an issue or submit a PR.

Install • Quick Start • Features • Commands • Loops • Architecture

CraftedCode Terminal


Install

CraftedCode Install

One-line install (macOS + Linux)

curl -fsSL https://raw.githubusercontent.com/seyhunak/craftedcode/main/install.sh | bash

Omarchy / Arch Linux

sudo pacman -S swift git curl python
curl -fsSL https://raw.githubusercontent.com/seyhunak/craftedcode/main/install.sh | bash
# or from a checkout:
make release && make install            # → /usr/local/bin
make install PREFIX=~/.local            # → ~/.local/bin

Build from source

git clone https://github.com/seyhunak/craftedcode
cd craftedcode
swift build -c release
cp .build/*/release/crafted ~/.local/bin/
# macOS alternative: ./build.sh  (.app bundle + DMG)

Manual install

cp dist/crafted ~/.local/bin/

Quick Start

1. Configure your LLM provider

CraftedCode supports 5 providers out of the box. Set your API key:

# Ollama (local, no API key needed)
crafted
❯ /provider ollama

# OpenAI
❯ /provider openai
❯ /config openai_key sk-...

# Anthropic
❯ /provider anthropic
❯ /config anthropic_key sk-ant-...

# OpenRouter
❯ /provider openrouter
❯ /config openrouter_key sk-or-...

# Google AI
❯ /provider google
❯ /config google_key AIza...

Or create .craftedcode.llm.json in your project root:

{
  "providers": {
    "openai": { "key": "sk-..." }
  },
  "activeProvider": "openai",
  "activeModel": "gpt-4o"
}

2. Start the REPL

crafted

You'll see a welcome banner and an interactive prompt. Type /help to see all commands.

3. Try your first commands

# Generate project context (run once per project)
❯ /init

# Ask about your codebase
❯ /ask What does the auth module do?

# Chat with full project context
❯ /chat How would you improve error handling here?

# Run an autonomous coding loop
❯ /loop coding Add input validation to the login endpoint

# Generate a commit message from staged changes
❯ /commit

# Generate tests for a file
❯ /testgen Sources/Auth/LoginManager.swift

4. Explore more

# Discover available MCP tools
❯ /mcp tools

# Run an MCP agent
❯ /mcp run crafted <your task>

# Check your setup
❯ /doctor

# Switch color theme
❯ /theme dark

Features

AI-Powered Development

  • LLM Chat — Talk to AI with full project context
  • Codebase Q&A — Ask questions about your code
  • Intent Detection — Free text auto-routes to MCP tools
  • 5 Providers — Ollama, OpenAI, Anthropic, OpenRouter, Google AI
  • Dynamic Models — Fetch available models from live APIs

MCP Integration

  • 92+ Tools — Connected to Langflow agents
  • Auto-Discover — Tools found on first call
  • Direct HTTP — curl-based transport (no URLSession issues)
  • Multiple Servers — Add/remove MCP servers
  • Fuzzy Matching — "energy trading deal processing agent" matches energy_trading_deal_processing
  • MCP Server — Expose CraftedCode as an MCP server
  • MCP Cache — Cache tool results for faster repeated calls

Autonomous Loops

  • 10 Built-in Loops — coding, research, content, sales, debug, review, refactor, test, document, optimize
  • Custom Loops — Create your own with /loop add
  • Loop Chaining — Run multiple loops sequentially
  • Watch Loops — Auto-run loops on file changes
  • Auto-Retry — Failed checks trigger retry from the failed step
  • Configurable — Save/load custom loops from .craftedcode/loops.json

Security & Compliance (NEW)

  • /fraud — Fraud detection: payment bypass patterns, IDOR vulnerabilities, price manipulation
  • /kyc — KYC compliance: identity verification, age verification, document upload checks
  • /pii — PII scanner: SSN, credit cards, emails, phone numbers, API keys
  • /code quality — Code quality analysis: file sizes, function lengths, TODO/FIXME markers

Authentication (NEW)

  • /login — Login to Supabase with email/password
  • /login signup — Create account and login
  • /logout — Sign out and clear session
  • Secure input — Password masking in terminal

Terminal Pet (NEW)

  • /pet — Pick a terminal buddy: cat, dog, or bunny
  • ASCII art — Cute animated pets in your terminal

AI-Powered Commands

  • /commit — AI-generated commit messages from staged changes
  • /pr — Create GitHub PRs with AI descriptions
  • /testgen — Auto-generate test cases for any file
  • /refactor — AI-powered code refactoring
  • /document — Auto-generate documentation and docstrings

DevOps Tools

  • /deps — Dependency management (Swift PM, NPM, pip, Bundler)
  • /port — Check, find, and kill processes on ports
  • /log — Tail log files
  • /env — Environment variable management with .env support
  • /mock — Generate realistic mock data (JSON, CSV, lists)

Session Management

  • /notes — Persistent session notes
  • /journal — Development journal with timestamps
  • /handoff — Generate handoff documents for next session

Code Intelligence

  • /analyze — Code complexity analysis with scoring (1-10)
  • /predict — Predict potential bugs from code patterns
  • /suggest — Context-aware improvement suggestions
  • /compare — Compare code approaches side-by-side

Code Quality

  • /smell — Detect code smells and anti-patterns
  • /metrics — Code metrics (lines, functions, complexity)
  • /changelog — Auto-generate CHANGELOG.md from git history
  • /bump — Semantic version bumping (major/minor/patch)

Automation

  • /automate — Record and replay multi-step workflows
  • /schedule — Schedule recurring tasks (daily, hourly, weekly)
  • /pipeline — Chain commands with sequential execution

Learning

  • /interactive — Step-by-step guided tutorials
  • /eli5 — Explain complex code like you're 5
  • /quiz — Test your knowledge with quizzes
  • /visualize — Generate ASCII diagrams of code

Obsidian Integration

  • /obsidian — Full Obsidian vault integration
  • /obsidian set vault — Configure vault path
  • /obsidian read — Read notes with markdown rendering
  • /obsidian ask — Ask LLM about vault content
  • /obsidian save — Save markdown to vault
  • /obsidian auto-learn — Auto-save LLM responses as learning notes (enabled by default)

Integrations

  • /github — GitHub issues, PRs, Actions, repos
  • /slack — Send Slack notifications
  • /linear — Linear project management

Session Persistence

  • /workspace — Save and restore workspaces
  • /snapshot — Save/restore project state
  • /replay — Replay session history

Performance

  • /profile — CPU/memory profiling
  • /benchmark — Run and compare benchmarks
  • /trace — Execution tracing

Web Search

  • /web — Search the web for information
  • /web fetch — Fetch and summarize a URL
  • /web query — Explicitly search

Context7 Documentation

  • /docs — Look up library documentation via Context7
  • Real-time docs for React, Next.js, Express, and more

AI-Powered Analysis

  • /explain line — Explain specific code lines
  • /debug — Debug errors with AI analysis
  • /git-blame — AI-annotated git blame
  • /dependency-graph — Visualize code dependencies

Developer Experience

  • /doctor — Health check: config, tools, connectivity
  • /changelog-gen — Generate CHANGELOG from git history
  • /version — Semantic version management (get/bump/set)
  • /generate — Project templates (swift-file, swift-view, api-client, test-file, cli, readme, rails, django, flask, docker, k8s, dockerfile, compose)

    Code Quality+

    • /pre-commit — Run pre-commit checks (lint, secrets, sizes)
    • /license — Add LICENSE file (MIT, Apache2, GPL3, BSD3)
    • /gitignore — Generate .gitignore (swift, node, python, xcode, docker)
    • /security-scan — Scan for secrets and vulnerabilities
    • /complexity — Code complexity metrics and analysis

    Collaboration

    • /jira — Search and create Jira tickets
    • /notion — Query Notion databases
    • /confluence — Search Confluence docs

    Power Features

    • /fork — Fork and clone GitHub repositories
    • /deploy — Deploy to Vercel, Fly.io, Railway, Heroku, Docker
    • /env-sync — Sync .env files across environments
    • /ci-status — Check GitHub Actions status
    • /release — Create GitHub releases with auto-generated notes

    AI-Powered+

    • /refactor — AI-powered code refactoring with context analysis
    • /architect — AI architecture analysis and recommendations
    • /review changes — Review staged changes with AI
    • /explain concept — Deep concept explanations
    • /generate test — Generate unit tests from source code

    Developer Tools+

    • /convert — Convert data formats (JSON↔YAML, JSON↔TOML)
    • /format — Auto-format code (SwiftFormat, Prettier, Black)
    • /sort imports — Sort imports alphabetically
    • /remove unused — Find and remove unused code
    • /generate docs — Generate markdown documentation

    Project Management

    • /sprint — Start, end, or show sprint status
    • /standup — Generate standup summary from git
    • /retro — Generate sprint retrospective
    • /estimate — AI effort estimation for tasks
    • /prioritize — AI task prioritization with ICE scoring

    Collaboration+

    • /discord — Format messages for Discord
    • /teams — Format messages for Microsoft Teams
    • /email draft — Draft emails with AI
    • /meeting notes — Generate meeting notes from files
    • /summary — Project summary with metrics

    Code Generation

    • /generate — Scaffold from templates (swift, rails, django, flask, docker, k8s, dockerfile, compose)
    • /api — Generate REST API (Express, Vapor)
    • /graphql — Generate GraphQL schema and resolvers
    • /migration — Generate database migrations (Prisma, Sequelize, Knex, Alembic)
    • /schema — Generate JSON Schema or TypeScript types
    • /openapi — Generate OpenAPI specification

    Automation+

    • /cron — Manage scheduled tasks (list, add, remove)
    • /workflow — Manage saved workflows (list, run, create)
    • /batch — Run multiple commands in sequence
    • /queue — Queue commands for sequential execution
    • /retry — Auto-retry failed commands with backoff

    Database & API

    • /sql explain — Explain SQL query execution plan
    • /sql generate — Generate SQL from natural language
    • /sql optimize — Optimize slow SQL queries
    • /test api — HTTP client (GET, POST, PUT, DELETE, PATCH)
    • /mock api — Create mock API servers

    Performance

    • /profile — Full profiling (CPU, memory, time, I/O)
    • /bundle analyze — Analyze bundle size
    • /bundle check — Check bundle health
    • /memory usage — Show system memory usage
    • /memory leaks — Check for memory leaks
    • /benchmark run — Run benchmarks
    • /benchmark compare — Compare benchmark runs

    Git Advanced

    • /bisect — Git bisect automation (start, good, bad, run)
    • /worktree — Git worktree management (list, add, remove)
    • /stash — Git stash operations (list, save, pop, apply, drop, clear)
    • /squash — Squash commits (last, interactive)

    Security

    • /audit deps — Audit dependencies (npm, swift, python)
    • /sbom — Generate Software Bill of Materials
    • /license check — Scan and verify licenses

    AI Agents

    • /agent spawn — Spawn AI agents for tasks
    • /agent memory — Query agent memory
    • /task decompose — Break tasks into subtasks
    • /task estimate — Estimate task complexity

    Developer Experience

    • /onboard generate — Generate onboarding documentation
    • /context pack — Create and share context packs
    • /learn — Interactive learning (topics, quizzes, paths)

    DevOps

    • /docker compose — Docker Compose management
    • /k8s — Kubernetes manifest generation and deployment
    • /terraform — Terraform configuration and management
    • /monitoring — Monitoring dashboards and alerts

    Metrics

    • /dora — DORA metrics (deployment frequency, lead time, etc.)
    • /velocity — Team velocity tracking and trends
    • /heatmap — Code change heatmaps (file, author, time)

    Code Pipeline

    • 4-Agent System — FilePicker → Planner → Editor → Reviewer
    • Real Diffs — LCS-based unified diffs
    • Apply/Review — Dry-run before writing to disk
    • Git Integration — Auto-snapshot, commit, status

    Utility Commands

    • /lint — Auto-detect and run linters (SwiftLint, ESLint, etc.)
    • /security — Scan for vulnerabilities and secrets
    • /explain — LLM-powered code explanations
    • /bench — Performance benchmarks
    • /generate — Scaffold files from templates (swift, rails, django, flask, docker, k8s)
    • /test — Auto-detect and run test frameworks
    • /docker — Container management
    • /db — Database queries (SQLite, PostgreSQL, MySQL)
    • /api — REST API testing
    • /share — Export session as markdown
    • /macro — Record and replay command sequences
    • /find — Search code with ripgrep

    Display & Export

    • /theme — Switch color themes (default, dark, green, minimal)
    • /export — Export session as HTML, JSON, or Markdown

    Terminal UI

    • Native macOS — Swift binary, no dependencies
    • Rich Output — Markdown rendering with tables, headers, code blocks
    • Session Tracking — 32-char hex ID per run
    • Skill Discovery — 335+ agent skills from ~/.hermes, ~/.agents, ~/.claude

    Loops

    Loops are autonomous agent workflows: Goal → Action → Check → Fix → Repeat.

    Built-in Loops

    Loop Description Steps Max Iters
    coding Read → Plan → Edit → Test → Fix → Summarize 6 5
    research Define → Search → Summarize → Verify → Synthesize 5 3
    content Define → Draft → Critique → Rewrite → Score → Publish 6 3
    sales ICP → Find leads → Enrich → Qualify → Personalize → Send 7 2
    debug Reproduce → Isolate → Hypothesize → Fix → Verify 6 3
    review Scan → Analyze → Score → Report 4 2
    refactor Identify → Plan → Extract → Simplify → Verify 6 3
    test Analyze → Plan → Write tests → Run → Fix → Coverage report 6 3
    document Scan → Structure → Draft → Review → Finalize 5 2
    optimize Profile → Identify → Optimize → Benchmark → Validate → Report 6 2

    Loop Commands

    Command Description
    /loop <type> <goal> Run a loop
    /loop chain <l1> <l2> -- <goal> Chain loops sequentially
    /loop list List all loops (built-in + custom)
    /loop show <name> Show loop details and steps
    /loop add <name> | <desc> | <steps> | <max_iters> Create a custom loop
    /loop remove <name> Delete a custom loop
    /watchloop <loop> <goal> Watch files and run loop on change

    Creating Custom Loops

    # Simple deployment loop
    /loop add deploy | Build and deploy to staging | shell:swift build, shell:swift test, shell:./deploy.sh staging, llm:Verify deployment | 3
    
    # Research with web search
    /loop add competitor | Analyze competitor | llm:Define what to research, shell:curl -s https://example.com, llm:Summarize findings | 2

    Step types:

    • llm:<prompt> — LLM call with {goal} and {result} template variables
    • shell:<command> — Shell command execution
    • read:<path> — Read a file
    • mcp:<tool>:<input> — MCP tool call

    Loop Examples

    # Coding
    /loop coding Add error handling to the auth module
    
    # Debug
    /loop debug Fix the login timeout bug
    
    # Research
    /loop research Compare React vs Vue for our dashboard
    
    # Content
    /loop content Write a blog post about MCP integration
    
    # Sales
    /loop sales Find CTO leads at fintech startups Series A+
    
    # Code Review
    /loop review Review the payment module for issues
    
    # Testing
    /loop test Add unit tests for the user service
    
    # Refactoring
    /loop refactor Extract database logic into a repository pattern
    
    # Chain loops
    /loop chain review refactor -- Improve code quality in payment module
    
    # Watch loop
    /loop watchloop coding Add error handling Sources/

    Commands Reference

    Security & Compliance (NEW)

    Command Description
    /fraud Detect fraud patterns: payment bypass, IDOR, price manipulation
    /fraud help Show fraud detection help
    /kyc KYC compliance: identity verification, age checks, document validation
    /kyc help Show KYC compliance help
    /pii Scan for PII: SSN, credit cards, emails, phone numbers, API keys
    /pii help Show PII scanner help
    /code quality Analyze code quality: file sizes, function lengths, TODO markers
    /code quality help Show code quality help

    Authentication (NEW)

    Command Description
    /login [email password] Login to Supabase
    /login signup <email> <password> [name] Create account and login
    /logout Sign out and clear session

    Terminal Pet (NEW)

    Command Description
    /pet Pick a terminal buddy
    /pet 1 or /pet cat Choose cat
    /pet 2 or /pet dog Choose dog
    /pet 3 or /pet bunny Choose bunny

    Pipeline Commands

    Command Description
    /plan <task> Plan changes without applying
    /run <task> Full pipeline: plan → edit → review
    /apply [--dry-run] Apply patches to disk
    /undo Restore files to before last /apply
    /review Review pending patches
    /diff [file] Show detailed diffs

    Tool Commands

    Command Description
    /cmd <shell> Run shell command
    /files [filter] List project files
    /git [status|msg] Git operations
    /watch [path] Watch for file changes

    LLM Commands

    Command Description
    /chat <message> Talk to LLM with project context
    /ask <question> Ask about your codebase
    /model [name] Switch or list models
    /provider [name] Switch or list providers
    /reset Clear conversation history

    Skill Commands

    Command Description
    /skills [query] Discover agent skills
    /skill <name> Load skill context into LLM

    MCP Commands

    Command Description
    /mcp List MCP servers and tools
    /mcp tools Show all available tools
    /mcp discover Scan servers for tools
    /mcp stats Show server and tool statistics
    /mcp ping [server] Ping server(s) for health
    /mcp call <tool> <input> Call an MCP tool
    /mcp run <server> [input] Run an MCP server
    /mcp serve [port] Expose as MCP server (default: 8765)
    /mcp cache Show/manage MCP cache
    /mcp cache clear Clear cached results
    /mcp cache stats Show cache statistics
    /mcp add <key> <cmd> [args] Add MCP server
    /mcp remove <key> Remove MCP server

    Loop Commands

    Command Description
    /loop <type> <goal> Run autonomous agent loop
    /loop chain <l1> <l2> -- <goal> Chain loops sequentially
    /loop list List all loops
    /loop show <name> Show loop details
    /loop add ... Create custom loop
    /loop remove <name> Delete custom loop
    /watchloop <loop> <goal> Watch files, run loop on change

    AI Development Commands

    Command Description
    /commit [all] AI-generated commit messages
    /pr Create GitHub PRs with AI descriptions
    /testgen <file> Auto-generate test cases
    /refactor <file> [instruction] AI-powered code refactoring
    /document <file|all> Auto-generate documentation

    DevOps Commands

    Command Description
    /deps [list|outdated|tree|audit] Dependency management
    /port [port|list|kill] Check/kill processes on ports
    /log <file> [lines] Tail log files
    /env [get|set|list] Environment variable management
    /mock [json|csv|list] Generate mock data

    Session Commands

    Command Description
    /notes <text> Persistent session notes
    /journal <text|today|week> Development journal
    /handoff Generate handoff document

    Utility Commands

    Command Description
    /alias <cmd> = <actual> Create custom command alias
    /lint [file|dir] Run linters (SwiftLint, ESLint, etc.)
    /security [scope] Scan for vulnerabilities
    /explain <code|concept> LLM-powered explanation
    /bench [scope] Performance benchmarks
    /generate <template> Scaffold files from templates (swift, rails, django, flask, docker, k8s)
    /test [framework|file] Run tests automatically
    /docker [command] Docker container management
    /db <query> Query databases (SQLite, PG, MySQL)
    /api <method> <url> Test REST APIs
    /share [scope] Export session as markdown
    /macro [subcommand] Record/replay command sequences
    /find <query> Search code with ripgrep

    Display Commands

    Command Description
    /theme [name] Switch color themes (default, dark, green, minimal)
    /export [html|json|md] Export session in various formats

    Config Commands

    Command Description
    /init Generate context.md for project
    /config [key val] Configuration
    /history [n] Command history
    /clear Clear terminal
    /help [section] Help
    /version Version info
    /exit Quit

    Code Intelligence Commands

    Command Description
    /analyze <file> Code complexity analysis with scoring
    /predict <file> Predict potential bugs from patterns
    /suggest <file> Context-aware improvement suggestions
    /compare <file> [file2] Compare code approaches side-by-side

    Code Quality Commands

    Command Description
    /smell <file> Detect code smells and anti-patterns
    /metrics <file> Code metrics (lines, functions, complexity)
    /changelog Auto-generate CHANGELOG.md from git history
    /bump major|minor|patch Semantic version bumping

    Automation Commands

    Command Description
    /automate <name> = <cmds> Create reusable workflow
    /automate list List all workflows
    /automate run <name> Run a workflow
    /schedule <interval> <cmd> Schedule recurring tasks
    /schedule list List schedules
    /pipeline <name> = <steps> Chain commands sequentially
    /pipeline list List pipelines
    /pipeline run <name> Run a pipeline

    Learning Commands

    Command Description
    /interactive <topic> Step-by-step guided tutorials
    /eli5 <code|concept> Explain like you're 5 years old
    /quiz <topic> Test your knowledge with quizzes
    /visualize <file|concept> Generate ASCII diagrams
    /learn <topic> Learn about a topic
    /learn quiz <topic> Generate quiz on topic
    /learn path <topic> Create learning path

    Obsidian Commands

    Command Description
    /obsidian Show help
    /obsidian set vault <path> Set vault directory
    /obsidian read <file> Read a note
    /obsidian ask <query> Ask LLM about vault content
    /obsidian save <name> Save markdown to vault
    /obsidian list [filter] List vault files
    /obsidian status Show vault status
    /obsidian auto-learn on|off Auto-save LLM responses

    Integration Commands

    Command Description
    /github issues List GitHub issues
    /github prs List pull requests
    /github actions List workflow runs
    /github create-issue <title> Create a GitHub issue
    /slack <message> Send Slack notifications
    /linear list List Linear issues
    /linear create <title> Create Linear issue

    Session Management Commands

    Command Description
    /workspace save <name> Save current workspace
    /workspace restore <name> Restore saved workspace
    /workspace list List saved workspaces
    /snapshot [name] Save project state
    /snapshot list List snapshots
    /snapshot restore <id> Restore a snapshot
    /replay last [n] Replay last n commands
    /replay session <id> Replay a full session

    Performance Commands

    Command Description
    /profile <command> CPU/memory profiling
    /benchmark <command> Run and compare benchmarks
    /trace <command> Execution tracing

    Keyboard Shortcuts

    Key Action
    ↑ / ↓ Navigate command history
    ← / → Move cursor
    Ctrl-A Move to start of line
    Ctrl-E Move to end of line
    Ctrl-K Kill to end of line
    Ctrl-U Kill to start of line
    Backspace Delete character

    Architecture

    craftedcode/
    ├── Sources/
    │   ├── main.swift              # CLI entry, arg parsing
    │   ├── REPL.swift              # Interactive REPL
    │   ├── LineEditor.swift        # Raw terminal input
    │   ├── InputHistory.swift      # Command history
    │   ├── Core/
    │   │   ├── State.swift         # App state, session ID
    │   │   ├── LLMProvider.swift   # 5 LLM providers
    │   │   ├── MCPClient.swift     # MCP HTTP transport + fuzzy matching
    │   │   ├── MCPCache.swift      # MCP tool result caching
    │   │   ├── SkillDiscovery.swift# Skill scanning
    │   │   ├── Diff.swift          # LCS-based diffs
    │   │   ├── FileSystem.swift    # File operations
    │   │   ├── ProcessRunner.swift # Shell execution
    │   │   ├── ConversationStore.swift # Chat history persistence
    │   │   ├── SimpleHTTPServer.swift  # MCP server support
    │   │   ├── AgentManager.swift  # Centralized agent orchestration
    │   │   ├── SupabaseClient.swift # Supabase authentication
    │   │   └── Terminal.swift      # Terminal abstraction
    │   ├── UI/
    │   │   ├── Theme.swift         # Colors, banner, prompt
    │   │   ├── Spinner.swift       # Animated spinner
    │   │   ├── Logger.swift        # Colored output
    │   │   └── MarkdownRenderer.swift # Terminal markdown
    │   ├── Commands/
    │   │   ├── ChatCommand.swift   # LLM chat
    │   │   ├── AskCommand.swift    # Codebase Q&A
    │   │   ├── LoopCommand.swift   # Autonomous loops
    │   │   ├── MCPCommand.swift    # MCP management + serve/cache
    │   │   ├── MCPIntentCommand.swift # Intent detection
    │   │   ├── PlanCommand.swift   # Planning
    │   │   ├── RunCommand.swift    # Pipeline
    │   │   ├── ApplyCommand.swift  # Apply patches
    │   │   ├── ReviewCommand.swift # Review
    │   │   ├── DiffCommand.swift   # Diffs
    │   │   ├── InitCommand.swift   # context.md generator
    │   │   ├── CommitCommand.swift # AI commit messages
    │   │   ├── PRCommand.swift     # GitHub PR creation
    │   │   ├── TestGenCommand.swift # Test generation
    │   │   ├── RefactorCommand.swift # AI refactoring
    │   │   ├── DocumentCommand.swift # Auto-documentation
    │   │   ├── DepsCommand.swift   # Dependency management
    │   │   ├── PortCommand.swift   # Port management
    │   │   ├── LogCommand.swift    # Log tailing
    │   │   ├── EnvCommand.swift    # Environment variables
    │   │   ├── MockCommand.swift   # Mock data generation
    │   │   ├── NotesCommand.swift  # Session notes
    │   │   ├── JournalCommand.swift # Development journal
    │   │   ├── HandoffCommand.swift # Session handoff
    │   │   ├── FindCommand.swift   # Code search
    │   │   ├── ThemeCommand.swift  # Color themes
    │   │   ├── ExportCommand.swift # Session export
    │   │   ├── FraudCommand.swift  # Fraud detection (NEW)
    │   │   ├── KYCCommand.swift    # KYC compliance (NEW)
    │   │   ├── PIICommand.swift    # PII scanner (NEW)
    │   │   ├── CodeQualityCommand.swift # Code quality (NEW)
    │   │   ├── LoginCommand.swift  # Supabase login (NEW)
    │   │   ├── LogoutCommand.swift # Supabase logout (NEW)
    │   │   ├── PetCommand.swift    # Terminal pet (NEW)
    │   │   └── ...                 # Other commands
    │   ├── Agents/
    │   │   ├── FilePicker.swift    # File selection
    │   │   ├── Planner.swift       # Change planning
    │   │   ├── Editor.swift        # Code editing
    │   │   └── Reviewer.swift      # Security review
    │   └── Kami/
    │       └── KamiDocumentGenerator.swift # PDF report generation
    ├── assets/
    │   └── logo.png                # App icon
    ├── build.sh                    # Build + .app bundle + DMG script
    ├── install                     # curl installer
    ├── Package.swift               # Swift package
    └── README.md
    

    Key Components

    • LineEditor — Raw terminal input with arrow keys, cursor movement
    • LLMClient — Actor-based async LLM communication
    • MCPClient — curl-based HTTP transport with fuzzy tool matching
    • MCPCache — Tool result caching with TTL
    • SimpleHTTPServer — MCP server support (JSON-RPC 2.0)
    • LoopCommand — Autonomous agent loops with retry logic
    • MarkdownRenderer — Terminal markdown with tables, headers, code blocks
    • SkillDiscovery — Scans ~/.hermes, ~/.agents, ~/.claude for skills
    • Spinner — Animated braille spinner during async operations
    • AgentManager — Centralized agent orchestration with multiple providers (NEW)
    • SupabaseClient — Authentication with secure token management (NEW)
    • KamiDocumentGenerator — PDF report generation with markdown input (NEW)

    Configuration

    Project config

    .craftedcode.json in project root:

    {
      "ignorePatterns": ["node_modules", ".git", "dist"],
      "maxFileSizeKB": 500,
      "autoReview": true,
      "gitAutoCommit": true,
      "theme": "default",
      "obsidianVaultPath": "/path/to/vault",
      "autoLearn": true
    }

    MCP config

    .mcp.json in project root:

    {
      "mcpServers": {
        "crafted": {
          "command": "uvx",
          "args": ["mcp-proxy", "http://localhost:7860/api/v1/mcp/..."]
        }
      }
    }

    LLM config

    .craftedcode.llm.json in project root:

    {
      "providers": {
        "ollama": { "key": "" },
        "openai": { "key": "sk-..." }
      },
      "activeProvider": "ollama",
      "activeModel": "llama3"
    }

    Custom Loops

    .craftedcode/loops.json in project root (auto-created on /loop add):

    {
      "customLoops": {
        "deploy": {
          "name": "deploy",
          "description": "Build and deploy to staging",
          "steps": [
            { "name": "Build", "actionType": "shell", "actionPayload": "swift build" },
            { "name": "Test", "actionType": "shell", "actionPayload": "swift test" },
            { "name": "Deploy", "actionType": "shell", "actionPayload": "./deploy.sh staging" }
          ],
          "maxIterations": 3,
          "builtin": false
        }
      }
    }

    Environment Variables

    .env in project root (managed via /env set):

    OPENAI_API_KEY=sk-...
    ANTHROPIC_API_KEY=sk-ant-...
    DATABASE_URL=postgres://localhost/mydb
    SUPABASE_URL=https://your-project.supabase.co
    SUPABASE_ANON_KEY=your-anon-key
    

    Requirements

    • macOS 13+ (Ventura or later)
    • Xcode 15+ or Swift 5.9+ toolchain
    • No Node.js — pure native Swift
    • Optional: GitHub CLI (gh) for PR commands


    Development

    # Dev build
    swift build
    
    # Run
    swift run crafted
    
    # Release build
    swift build -c release
    
    # Build + DMG
    ./build.sh
    
    # Install globally
    cp dist/crafted ~/.local/bin/

    License

    MIT © CraftedCode

About

Native AI coding terminal — by SeyhunAkyurek

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages