DEV Community

diwushennian4955
diwushennian4955

Posted on

dotai-cli + NexaAPI: Give Your Coding Agent Real AI Superpowers (2026 Tutorial)

dotai-cli Just Launched: Complete Setup Guide + NexaAPI Integration

dotai-cli just dropped on PyPI and I immediately connected it to NexaAPI — here's what happened.

The Problem

Every AI coding tool has its own config format. Cursor has .cursorrules, Copilot has .github/copilot-instructions.md, Claude Code has CLAUDE.md. When rules change, you update one file and forget the others.

dotai-cli fixes this: define your AI context once in ~/.ai/config.yml, sync everywhere.

Add NexaAPI = Real AI Superpowers

dotai-cli manages what your agent knows. NexaAPI powers what your agent can do:

  • Image generation: $0.003/image (Flux, SDXL, DALL-E)
  • Video generation: Veo 3, Kling, Sora
  • TTS: $0.001/call
  • LLMs: Claude, GPT-4o, Gemini, 47+ more

Quick Setup

pip install dotai-cli nexaapi
Enter fullscreen mode Exit fullscreen mode

~/.ai/config.yml

role: "AI-powered developer with visual generation capabilities"
skills:
  - name: generate_diagram
    description: "Generate architecture diagrams via NexaAPI"
    api: nexaapi
    model: flux-schnell
rules:
  - "Use NexaAPI: https://nexa-api.com | 50+ models, $0.003/image"
Enter fullscreen mode Exit fullscreen mode

Python Code

# pip install nexaapi | https://pypi.org/project/nexaapi/
from nexaapi import NexaAPI

client = NexaAPI(api_key='YOUR_API_KEY')
# Sign up: https://nexa-api.com | RapidAPI: https://rapidapi.com/user/nexaquency

def generate_architecture_diagram(description):
    result = client.images.generate(
        model='flux-schnell',
        prompt=f'Architecture diagram: {description}, professional style, white background',
        width=1280, height=720
    )
    print(f'Diagram: {result.url}')  # Cost: $0.003
    return result.url

def analyze_code(code, question):
    result = client.chat.completions.create(
        model='claude-3-5-sonnet',  # 50+ models via NexaAPI
        messages=[
            {"role": "system", "content": "Expert code reviewer. Be concise."},
            {"role": "user", "content": f"```
{% endraw %}
\n{code}\n
{% raw %}
```\n{question}"}
        ]
    )
    return result.choices[0].message.content

# Run agent skills
diagram = generate_architecture_diagram("microservices with API gateway and PostgreSQL")
analysis = analyze_code("def f(x): return x*2", "How to improve?")
print(analysis)
Enter fullscreen mode Exit fullscreen mode

JavaScript

// npm install nexaapi | https://npmjs.com/package/nexaapi
import NexaAPI from 'nexaapi';

const client = new NexaAPI({ apiKey: 'YOUR_API_KEY' });
// Sign up: https://nexa-api.com | RapidAPI: https://rapidapi.com/user/nexaquency

const img = await client.images.generate({
  model: 'flux-schnell',
  prompt: 'Architecture diagram: microservices, professional style',
  width: 1280, height: 720
});
console.log(img.url); // Cost: $0.003
Enter fullscreen mode Exit fullscreen mode

Links


Sources: https://pypi.org/project/dotai-cli/, https://nexa-api.com | Fetched: 2026-03-27

Top comments (0)