Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Meza-dev/Ghostly/llms.txt

Use this file to discover all available pages before exploring further.

ghostly keygen generates a new API key and writes it into ~/.ghostly/auth.json, replacing any previously stored key while preserving your existing LLM configuration, API URL, and extra environment variables. Run this command when setting up a new machine, or any time you need to rotate credentials without going through the full interactive installer.

What it does

When invoked, keygen performs the following steps:
  1. Generates a new API key — a UUID v4 by default, or a 64-character random hex string when --token is passed.
  2. Reads the existing ~/.ghostly/auth.json (if present) to preserve apiUrl, llm, and extraEnv.
  3. Writes the updated auth object back to ~/.ghostly/auth.json with mode 0600.
The generated key is printed to the terminal so you can record it before it scrolls away.

Flags

--token
boolean
default:"false"
Generates a cryptographically random hex token (32 bytes → 64 hex characters) instead of the default UUID v4. Use this when an integration requires a non-UUID format.
--api-url
string
default:"http://localhost:4000"
Backend URL to associate with the generated key. This value is written to the apiUrl field in auth.json. If an existing auth.json already contains an apiUrl, that value takes precedence and this flag is ignored.

The ~/.ghostly/auth.json structure

After keygen runs, the file contains:
{
  "apiKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "apiUrl": "http://localhost:4000",
  "llm": { ... },
  "extraEnv": { ... }
}
The llm and extraEnv keys are only present if they existed in the file before the command ran — keygen never removes them.

Usage

ghostly keygen

Example output

◆  Nueva API Key generada y guardada en ~/.ghostly/auth.json
   Formato: uuid
   apiKey: 3f8a1c2e-47d6-4b09-a3e1-9f0c72b85d14

Key format comparison

FormatFlagExampleLength
UUID v4(none)3f8a1c2e-47d6-4b09-a3e1-9f0c72b85d1436 chars
Hex token--tokena3f8c2...d91464 chars
Each machine in your environment should have its own unique API key. Do not copy ~/.ghostly/auth.json between machines — run ghostly keygen on each one independently.

When to use keygen vs install

  • Use ghostly keygen when you only need to rotate the API key on an already-configured machine.
  • Use ghostly install for a fresh setup — it calls keygen internally and also configures the MCP server, installs Chromium, and copies Cursor rules.

Build docs developers (and LLMs) love