CLI Tool

The DevSpeak CLI lets you translate informal text into technical specifications directly from your terminal. Built on the [public API](/docs/api-reference), it supports piping, file output, and configurable defaults.

Quick Start

Get up and running in under two minutes:

---

Authentication

The CLI authenticates via API keys generated from the DevSpeak dashboard. Keys use a prefix-based format:

| Prefix | Environment |

| ----------- | ----------- |

| dsk_live_ | Production |

| dsk_test_ | Development |

devspeak login

Interactively or programmatically authenticate:

The CLI validates the key format (must start with dsk_) and verifies connectivity by hitting the /api/v1/health endpoint before saving.

---

Configuration

All configuration is stored at ~/.devspeakrc with chmod 600 (owner read/write only) for security. The file uses JSON format:

``json

{

"apiKey": "dsk_live_a1b2c3d4...",

"endpoint": "https://www.devspeak.dev",

"defaults": {

"audience": "Senior Dev",

"context": "Backend",

"format": "Technical Spec",

"tone": 75

}

}

`

devspeak config show

Display current configuration (API key is masked):

devspeak config set

Update individual configuration values:

Valid config keys: endpoint, audience, context, format, tone

---

Commands

devspeak optimize [input]

The core command. Transforms informal text into a technical specification.

Options:

| Flag | Description | Default |

| --------------------------- | ------------------------ | ---------------- |

| -a, --audience | Target audience | Senior Dev |

| -c, --context | Tech context | Backend |

| -f, --format | Output format | Technical Spec |

| -t, --tone | Verbosity (0–100) | 75 |

| -i, --instructions | Custom instructions | — |

| -o, --output | Write output to file | — |

| --json | Output raw JSON response | — |

Audience values: Junior Dev, Senior Dev, Tech Lead, SRE, Data Engineer

Context values: Backend, Frontend, Mobile, Data/ML, DevOps

Format values: Technical Spec, Jira Tickets, API Design, RFC, Data Model, Prompt, Optimize

---

Error Handling

The CLI provides clear error messages for common issues:

| Error | Cause | Solution |

| -------------------------------------- | ----------------------------- | ----------------------------------------- |

| No API key configured | Not authenticated | Run devspeak login |

| Input must be at least 10 characters | Input too short | Provide more descriptive text |

| Invalid API key format | Key doesn't start with dsk_ | Check your key in the dashboard |

| Cannot reach API | Network or endpoint issue | Check devspeak config show for endpoint |

| Rate limit exceeded | Too many requests | Wait 60 seconds and retry |

---

Security

  • Config file at ~/.devspeakrc is created with chmod 600 (owner-only access)
  • API keys are never logged or displayed in full — only the first 12 and last 4 characters are shown
  • All API communication uses HTTPS in production
  • Keys can be revoked instantly from the DevSpeak dashboard
  • > Never commit your .devspeakrc` file or share your API key. If a key is compromised, revoke it immediately from the dashboard and generate a new one.