Quick Start
This tutorial will help you get started with Octrafic CLI as quickly as possible.
Step 1: Install Octrafic
The quickest way to install:
curl -fsSL https://octrafic.com/install.sh | shiex (irm https://octrafic.com/install.ps1)For all installation options (Homebrew, AUR, DEB/RPM, Go, manual download), see the Installation page.
Step 2: First launch setup
When you start Octrafic for the first time, you'll go through a quick setup:
Choose your AI provider
- Anthropic Claude (recommended)
- OpenRouter (access to multiple models)
- OpenAI
- Ollama (local, no API key needed)
- llama.cpp (local, no API key needed)
Enter your API key (cloud providers) or server URL (local providers)
- Get Claude API key: console.anthropic.com
- Get OpenRouter API key: openrouter.ai/keys
- Get OpenAI API key: platform.openai.com
- For Ollama/llama.cpp, see Providers guide
Select a model
- Choose from available models for your provider
Your configuration is saved locally and you won't need to set it up again.
Step 3: Start your first session
There are three ways to start Octrafic:
Quick test (temporary session)
TIP
No OpenAPI spec? No problem. Use the built-in OOPS Auto-Scanner to generate api-spec.json directly from your source code using octrafic scan -p . -o api-spec.json.
For one-time testing without saving:
octrafic -u https://jsonplaceholder.typicode.com -s api-spec.jsonThis creates a temporary session that won't be saved.
Named project (saved for later)
To save a project for future use:
octrafic -u https://jsonplaceholder.typicode.com -s api-spec.json -n "My API Project"The project is saved and you can easily return to it later:
octrafic -n "My API Project"Browse saved projects
To see all your saved projects:
octraficThis opens an interactive list where you can:
- Navigate with arrow keys or
j/k - Search projects by pressing
/ - Select a project with
Enter - Quit with
q
Step 4: Ask your first question
Now you can interact with your API using natural language. Try asking:
what endpoints does this API have?Octrafic will analyze the OpenAPI spec and show you all available endpoints.
You can also ask more specific questions:
show me the users endpoint
what are the required fields for creating a post?
how do I authenticate requests?Step 5: Make your first API call
Test an endpoint directly:
get the first userOctrafic will:
- Find the appropriate endpoint
- Show you the request details
- Execute the call
- Display the response
Step 6: Explore and analyze
Ask Octrafic to analyze your API:
analyze the API structureOr get specific information:
what authentication methods are supported?
what are the response formats?
are there any rate limits?Step 7: Generate test cases
Automatically generate test cases from your spec:
generate tests for the users endpointOctrafic will create comprehensive test scenarios covering:
- Happy path
- Edge cases
- Error handling
- Validation
Essential commands
Starting Octrafic
| Command | What it does | Example |
|---|---|---|
octrafic -u <url> -s <spec> | Quick test (temporary) | octrafic -u https://api.example.com -s spec.yaml |
octrafic -u <url> -s <spec> -n "Name" | Create named project | octrafic -u https://api.example.com -s spec.yaml -n "Production API" |
octrafic -n "Name" | Load named project | octrafic -n "Production API" |
octrafic | Browse saved projects | octrafic |
Authentication flags
| Flag | What it does | Example |
|---|---|---|
--auth bearer --token <token> | Bearer authentication | --auth bearer --token abc123 |
--auth apikey --key <name> --value <val> | API key authentication | --auth apikey --key X-API-Key --value abc123 |
--auth basic --user <u> --pass <p> | Basic authentication | --auth basic --user admin --pass secret |
--clear-auth | Remove saved auth from project | --clear-auth |
In-session commands
| Command | What it does | Example |
|---|---|---|
/help | Show available commands | /help |
exit or Ctrl+C | Exit Octrafic | exit |
Common workflows
Testing a new API once
# Quick test without saving
octrafic -u https://test-api.com -s spec.jsonWorking with a production API
# Save for future use
octrafic -u https://api.example.com -s prod-spec.yaml -n "Production API"
# Return to it later from anywhere
octrafic -n "Production API"Managing multiple APIs
# Save different APIs
octrafic -u https://api1.com -s spec1.json -n "Stripe API"
octrafic -u https://api2.com -s spec2.json -n "GitHub API"
octrafic -u https://api3.com -s spec3.json -n "Client API"
# Browse and select
octrafic # Opens interactive list with searchUpdating a project
# Update with new spec or URL
octrafic -u https://api.example.com -s new-spec.yaml -n "Production API"
# You'll be prompted to confirm the updateManaging authentication
# Override auth with different credentials
octrafic -n "API" --auth bearer --token newtoken
# Clear saved authentication
octrafic -n "API" --clear-authNext steps
- Explore Authentication Methods
- Read about Project Management
