Skip to main content

When to use

  • Upload or deploy use case documents to the platform
  • After creating or updating stage markdown files in documents/
  • When deploying documentation alongside a use case

Prerequisites

  • codika CLI installed and authenticated
  • A use case folder with a documents/ subfolder containing stage markdown files
  • A project to deploy to (via project.json or PROJECT_ID in config.ts)

Document folder structure

my-use-case/
  project.json
  documents/
    1_business_requirements.md
    2_solution_architecture.md
    3_detailed_design.md
    4_implementation_plan.md
Files must follow the pattern {stage}_{name}.md:
PatternStageExample Title
1_*.md1”Business Requirements”
2_*.md2”Solution Architecture”
3_*.md3”Detailed Design”
4_*.md4”Implementation Plan”
Not all stages are required — the CLI uploads whichever stages exist.

Command

codika deploy documents <path> [options]

Arguments

ArgumentDescription
<path>Path to use case folder (must contain a documents/ folder with stage markdown files)

Options

OptionDescriptionDefault
--project-id <id>Override project IDproject.json
--project-file <path>Path to custom project fileproject.json
--api-url <url>Override API URL
--api-key <key>Override API keyProfile
--profile <name>Use a specific profile instead of the active one
--jsonJSON output

What happens on deploy

  1. Scans documents/ for files matching {1,2,3,4}_*.md
  2. For each file: derives title from filename, extracts summary from first paragraph (max 200 chars)
  3. Resolves project ID: --project-id > project.json > config.ts
  4. Uploads all documents to the platform in a single API call
  5. Reports per-stage results (document ID, version, status)

Document versioning

Documents are versioned on the platform:
  • First upload for a stage creates version 1.0.0
  • Subsequent uploads increment the minor version (e.g., 1.0.0 -> 1.1.0)
  • Each document version is tracked in the platform’s version_history collection

Examples

# Deploy documents
codika deploy documents ./my-use-case

# With explicit project ID
codika deploy documents ./my-use-case --project-id abc123

# JSON output for CI
codika deploy documents ./my-use-case --json

Output

Reading document files...
  Stage 1: 1_business_requirements.md -> "Business Requirements" (2450 chars, ~380 words)
  Stage 2: 2_solution_architecture.md -> "Solution Architecture" (5120 chars, ~790 words)

Uploading 2 document(s)...

✓ Documents Deployed Successfully

  Stage 1: v1.0.0 (doc-abc123)
  Stage 2: v1.0.0 (doc-def456)

  Request ID: req-789

Exit codes

CodeMeaning
0Documents deployed successfully
1Deployment failed