fern-api/fern/custom-commands
- community
Checking that the SKILL.md file is still in the repository.
How to author custom commands for the api CLI using the co-generated SDK.
Install
npx vskill@latest install fern-api/fern/custom-commandsSKILL.md
Custom Commands for api
Overview
The api CLI supports user-authored custom commands that are compiled into the binary alongside the auto-generated API commands. Custom commands get a fully-wired SDK client that inherits the CLI's auth, retries, TLS, base URL, and global headers — zero configuration required.
Architecture
Adding a Custom Command
1. Edit cli/api/custom.rs
This file is protected by .fernignore — fern generate will never overwrite it. Register commands in the register() function:
Then build and test:
2. Available SDK Clients
The super::sdk::client(ctx) call returns a api_sdk::api::Client with the following sub-clients:
| Field | Type | Description | |
|---|---|---|---|
client.imdb | api_sdk::api::ImdbClient | imdb operations |
3. Key Patterns
Get the SDK client (execution-sharing, fully authenticated):
Run an async SDK call from a sync handler:
Use typed models for request/response serialization:
4. Authentication
Custom commands automatically inherit the CLI's authentication. The following auth schemes are configured:
- bearer (bearer): env
API_TOKEN
No manual auth wiring is needed in custom command handlers.
Regeneration Safety
| File | Regenerated? | Notes | |
|---|---|---|---|
cli/api/custom.rs | No | Protected by .fernignore | |
cli/api/sdk.rs | Yes | Bridges AppContext → SDK client | |
cli/api/main.rs | Yes | Calls custom::register(app) | |
api-sdk/ | Yes | Co-generated typed SDK crate | |
api-types/ | Yes | Co-generated typed models |
After running fern generate, your custom.rs is preserved. All generated code (SDK, types, glue, main.rs) is updated to match the latest API spec. If the SDK surface changes (renamed methods, new sub-clients), update your custom.rs to match.
Build & Test
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingseed/cli/imdb/.agents/skills/custom-commands/SKILL.md
Popularity
- Repository stars
- 3,724
- Repository forks
- 331
- 7-day trend score
- 41
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fern-api/fern/custom-commands)