/ flydocs init

Initialize FlyDocs in a project with authentication, workspace selection, and artifact sync.

Synopsis

terminal
flydocs init [flags]

The primary setup command. Authenticates your API key, selects a workspace, pulls server configuration, and installs all managed artifacts into your project. This is the recommended way to get started with FlyDocs in any repository.

Options

Flag Type Default Description
--key string -- API key (fdk_...). Skips the interactive prompt if provided.
--project-key boolean false Store the credential in the project directory instead of globally.
--path string cwd Target directory for initialization.
--tier string -- local or cloud. Prompts interactively if omitted.
--single boolean false Initialize this one repo only. Never groups sibling repos into a workspace.
--workspace boolean false Treat the repos in this directory as one multi-repo workspace.
--scan boolean false Run AI scan after initialization to generate context files.
--local-source boolean false Use local templates instead of server templates. For development only.

What It Does

  1. Authenticates your API key against the relay API and stores credentials
  2. Selects workspace by prompting you to choose from available workspaces
  3. Pulls server config and creates .flydocs/config.json
  4. Syncs managed artifacts including skills, hooks, and slash commands
  5. Detects your stack from the project's package files and configuration
  6. Generates context files: project.md and service.json in flydocs/context/
  7. Updates .gitignore to exclude credential and cache files

In multi-repo workspaces, init also detects sibling repositories and creates a .flydocs-workspace.json at the workspace root with topology information.

Flat or multi-repo

Pick flat (flydocs init --single, run inside the repo) when you work in one repository. The repo holds its own FlyDocs files. A single-repo install never writes FlyDocs files into the parent folder or turns it into a workspace.

Pick multi-repo (flydocs init --workspace, run in the parent folder) when several repos should share one set of skills and one topology. See Workspaces & Topology. If an older --single install left a one-repo wrapper in the parent folder, flydocs doctor --fix converts it back.

AGENTS.md

FlyDocs writes its instructions into AGENTS.md as its own block, between <!-- flydocs:start --> and <!-- flydocs:end -->. Everything outside the block is kept byte for byte: your hand-written instructions, and other tools' blocks such as Next.js's <!-- BEGIN:nextjs-agent-rules -->. FlyDocs creates AGENTS.md only when none exists. .claude/CLAUDE.md gets the same treatment.

Examples

Interactive initialization in the current directory:

terminal
flydocs init

Non-interactive with an API key and cloud tier:

terminal
flydocs init --key fdk_abc123 --tier cloud

Initialize a different directory and run a scan afterward:

terminal
flydocs init --path ./my-project --scan

Related Commands