Skip to main content

CLI Reference

glue init

Initialize Glue in your project.
glue init
glue init demo
Detects your framework (Next.js or Vite) and package manager, creates .glue/ directories, configures your bundler, and adds required packages to devDependencies. Options:
  • --install — Auto-install dependencies without prompting
  • --skip-install — Skip dependency installation
  • --claude-plugin — Create Claude Code plugin files
  • -f, --force — Overwrite existing files

glue run

Run a dev command with Glue instrumentation.
glue run <command...>
glue run demo
Sets GLUE_INSTRUMENT=1, starts your dev server, detects the port, and auto-opens the Glue desktop app.
glue run npm run dev
glue run yarn dev
glue run pnpm dev
Options:
  • -f, --framework <name> — Force framework (next, vite)
  • --no-auto-detect — Disable framework auto-detection
Next.js 16+: Automatically forces webpack mode (Turbopack doesn’t yet support jsx-runtime aliasing). Port Detection: Checks PORT env var, then scans common ports (3000, 3001, 5173, 8080, etc.).

glue open

Launch the Glue desktop app.
glue open
Options:
  • --info — Display app information without launching
  • --port <port> — Connect to specific port
  • --url <url> — Connect to specific URL
  • --no-detect — Skip auto-detection

glue handoff

Export annotations and optionally launch Claude Code.
glue handoff
glue handoff demo
Auto-detects repo root and annotations, then generates handoff files. Options:
  • -a, --agent <agent> — Coding agent: claude-code
  • -r, --repo-root <path> — Repository root (auto-detected)
  • --annotations-path <path> — Custom annotations file location
  • --no-confirm — Skip confirmation prompts
  • --claude-plugin — Generate Claude Code plugin files
Generated files:
  • .glue/handoff/latest.md — Human-readable spec
  • .glue/annotations/latest.json — Machine-readable data
  • .glue/claude-plugin/ — Claude Code plugin (with --claude-plugin)

glue config

View or edit glue.toml configuration.
glue config --show    # View current config
glue config --edit    # Open in editor
glue config --reset   # Reset to defaults
glue config --show demo

Environment Variables

VariableDescription
GLUE_INSTRUMENTSet to 1 to enable instrumentation. Set automatically by glue run.
GLUE_ENABLEDLegacy alias for GLUE_INSTRUMENT (still supported).
PORTDev server port. Used by glue run for detection.
NODE_ENVGlue disables when set to production.

Exit Codes

CodeMeaning
0Success
1General error
2Configuration error
3App not found