Skip to main content

Wiki's for nerds, by nerds

Project description

Salt Docs CLI

Wiki's for nerds, by nerds

How it works

flowchart TD
    GH[GitHub] --> Pipeline
    Local[Local Dir] --> Pipeline

    subgraph Pipeline["⚙️ Processing Pipeline"]
        Crawl[Crawl & Analyze\nExtract + Parse] --> Identify[LLM Identify\nAbstractions]
        Identify --> Generate[Generate Docs\nMarkdown Output]
    end

    Generate --> Docs[Wiki Files]
    Docs --> Server[MCP Server]
    Server --> Tools["Tools:\nlist_docs | doc_id | get_docs"]

    Tools --> Cursor[Cursor]
    Tools --> Claude[Claude]
    Tools --> Continue[LLM's]

Installation

Option 1: Install from PyPI

pip install salt-docs

Option 2: Install from source

git clone https://github.com/itsjustmithun/salt-docs-cli.git
cd salt-docs-cli
pip install -e .

Quick Start

1. Initial Setup

Run the setup wizard to configure your API keys and preferences:

salt-docs init

This will:

  • Prompt for your Gemini API key
  • Optionally ask for GitHub token (for private repos)
  • Set default output location (~/Documents/Salt Docs)
  • Configure other preferences

2. Generate Documentation

Analyze GitHub repository

salt-docs --repo https://github.com/username/repo

Analyze local directory

salt-docs --dir /path/to/your/codebase

With custom options

salt-docs --repo https://github.com/username/repo --output /custom/path --language spanish --max-abstractions 10

Configuration

Salt Docs stores configuration in a per-user config file and uses your system's keyring for secure API key storage.

  • macOS/Linux: ~/.config/saltdocs/config.json (or $XDG_CONFIG_HOME/saltdocs/config.json)
  • Windows: %APPDATA%\saltdocs\config.json

Configuration Options

  • output_dir: Default output directory
  • language: Default language for generated docs
  • max_abstractions: Default number of abstractions to identify
  • max_file_size: Maximum file size in bytes
  • use_cache: Enable/disable LLM response caching
  • include_patterns: Default file patterns to include
  • exclude_patterns: Default file patterns to exclude

Managing Configuration

View Current Configuration

salt-docs config show

Update API Keys

# Update Gemini API key (interactive)
salt-docs config update-gemini-key

# Update Gemini API key directly
salt-docs config update-gemini-key "your-api-key-here"

# Update GitHub token (interactive)
salt-docs config update-github-token

# Update GitHub token directly
salt-docs config update-github-token "your-token-here"

Update Other Settings

# Change default language
salt-docs config set language spanish

# Change max abstractions
salt-docs config set max_abstractions 15

# Disable caching
salt-docs config set use_cache false

# Update output directory
salt-docs config set output_dir /custom/path

MCP Server Setup

Salt Docs includes an MCP (Model Context Protocol) server that exposes your generated documentation to AI assistants in IDEs like Cursor, Continue.dev, and Claude Desktop.

MCP Tools Available

The MCP server provides these tools:

  • list_docs - List all available documentation files
  • get_docs - Fetch the full content of a documentation file (by resource name or absolute path)
  • search_docs - Full-text search across documentation (paths, names, and resource names)
  • index_directories - Index directories for fast searching

Setup Instructions

Cursor

  1. Open or create your MCP configuration file:

    • macOS/Linux: ~/.cursor/mcp.json
    • Windows: %APPDATA%\Cursor\mcp.json
  2. Add the salt-docs server configuration:

{
  "mcpServers": {
    "salt-docs": {
      "command": "salt-docs",
      "args": ["mcp"]
    }
  }
}
  1. Restart Cursor to load the MCP server.

  2. The AI assistant in Cursor can now access your documentation using tools like:

    • "What documentation do we have?"
    • "Get me the documentation for 'SALT project"
    • "Read the README documentation"

Claude Desktop

  1. Open or create your Claude configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. Add the salt-docs server configuration:

{
  "mcpServers": {
    "salt-docs": {
      "command": "salt-docs",
      "args": ["mcp"]
    }
  }
}
  1. Restart Claude Desktop to load the MCP server.

Troubleshooting

  • Command not found: Make sure salt-docs is in your PATH. You can verify by running salt-docs --version in your terminal.
  • Server not starting: Ensure you've run salt-docs init and have generated at least one documentation project.
  • No docs found: The MCP server discovers docs from your configured output_dir. Run salt-docs config show to check your output directory.

Testing the MCP Server

You can test the MCP server directly:

salt-docs mcp

This will start the server in stdio mode (for MCP clients). To test locally, you can use the test scripts in the tests/ directory.

CLI Options

Required

  • --repo or --dir - GitHub repo URL or local directory path

Optional

  • -n, --name - Project name (derived from repo/directory if omitted)
  • -t, --token - GitHub personal access token
  • -o, --output - Output directory (overrides config default)
  • -i, --include - File patterns to include (e.g., ".py", ".js")
  • -e, --exclude - File patterns to exclude (e.g., "tests/", "docs/")
  • -s, --max-size - Maximum file size in bytes (default: 100KB)
  • --language - Language for generated docs (default: "english")
  • --no-cache - Disable LLM response caching
  • --max-abstractions - Maximum number of abstractions to identify (default: 10)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

salt_docs-0.1.8.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

salt_docs-0.1.8-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

Details for the file salt_docs-0.1.8.tar.gz.

File metadata

  • Download URL: salt_docs-0.1.8.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for salt_docs-0.1.8.tar.gz
Algorithm Hash digest
SHA256 17b60ad1fd6a62c180a9cc17f5bbe95ef56c6de027881a4866a07782f4a1df16
MD5 8a3fd6ffcdfb578c1716ff095bb6e240
BLAKE2b-256 eb448a4e22992f8f5cab723b0027ddd109544fdf77b3385afcace248bba8d618

See more details on using hashes here.

File details

Details for the file salt_docs-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: salt_docs-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 53.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for salt_docs-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b77b08b1a416e9d74612aa73f2d87b40500057cd2ba8d4c90271cc75ab57f001
MD5 9efdf690f7f6b60e12c583fecc57d8d3
BLAKE2b-256 5ac82a92d890c6800d0c3fc1a9cb15d47788ef9fd46302f3790e19f34c57b3cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page