matex-cli
v1.2.39
Published
Official CLI tool for MATEX AI - Access powerful AI models from your terminal
Maintainers
Readme
MATEX CLI
Official command-line interface for MATEX AI. Access powerful AI models directly from your terminal and edit code in your local files.
Features
- 🚀 Fast & Easy: Simple commands to interact with AI
- 🔐 Secure: API key-based authentication
- 💬 Interactive Chat: Continuous conversations with context
- 🤖 Multiple Models: Access MATEXCodex, MATEXAi, Elite, and more
- 💻 Local Development: Use AI to help write and edit code on your laptop/PC
- ⚡ Pro Plus Exclusive: Available for Pro Plus subscribers
Installation
npm install -g matex-cliQuick Start
1. Get Your API Key
- Log in to MATEX AI Platform
- Navigate to Settings → API Keys
- Click Generate New API Key
- Copy your key (starts with
sk-matex-)
2. Configure CLI
matex config set-key sk-matex-your-api-key-here3. Start Using
# Ask a single question
matex ask "What is 2+2?"
# Start interactive chat
matex chat
# Use for coding help
matex ask "Write a Python function to reverse a string" --model matexcodexUsing MATEX CLI for Local Development
Code Generation
Generate code directly in your terminal:
# Generate a complete function
matex ask "Create a React component for a login form" --model matexcodex
# Get code explanations
matex ask "Explain this error: TypeError: Cannot read property 'map' of undefined"
# Debug assistance
matex ask "Why is my async function not waiting for the promise?"Interactive Coding Session
Use chat mode for back-and-forth coding help:
matex chat --model matexcodex
> I need to create a REST API in Node.js
> [AI provides code]
> How do I add authentication to this?
> [AI provides auth code]
> Can you show me how to test this with Jest?
> [Conversation continues...]Copy Code to Your Files
Ask for code:
matex ask "Create a Python class for user management" --model matexcodexCopy the output from terminal
Paste into your local files using your favorite editor (VS Code, Sublime, etc.)
Best Practices for Local Development
- Use MATEXCodex model for coding tasks (
--model matexcodex) - Be specific in your requests (mention language, framework, requirements)
- Use chat mode for complex projects requiring multiple steps
- Save responses by redirecting output:
matex ask "..." > output.txt
Commands
matex config
Manage CLI configuration
# Set API key
matex config set-key <your-api-key>
# Show current configuration
matex config show
# Set default model
matex config set-model matexcodex
# Clear all configuration
matex config clearmatex ask
Ask a single question
matex ask "Your question here"
# Options:
# -m, --model <model> AI model (default: matexcodex)
# -t, --temperature <number> Temperature 0-1 (default: 0.7)
# --max-tokens <number> Max response tokens (default: 4000)Examples:
matex ask "Explain quantum computing"
matex ask "Write a REST API in Python" --model matexcodex
matex ask "Tell me a story" --model matexspiritmatex chat
Start an interactive chat session
matex chat
# Options:
# -m, --model <model> AI model (default: matexcodex)Example:
matex chat --model matexaiType exit or quit to end the session.
matex models
Manage AI models
# List all available models
matex models list
# Set default model
matex models set matexcodex
# Show current default model
matex models currentAvailable Models
| Model | Description | Access | |-------|-------------|--------| | matexcodex | Best for coding and technical tasks | Free (5 min/day), Starter (4M tokens/month), Pro Plus (unlimited) | | matexai | General purpose conversations | Pro, Pro Plus | | elite | Premium advanced capabilities | Elite Plan | | matexspirit | Creative and empathetic responses | Pro, Pro Plus |
Configuration
Configuration is stored in ~/.matex/config.json
{
"apiKey": "sk-matex-...",
"defaultModel": "matexcodex",
"baseURL": "https://matexai-backend-550499663766.us-central1.run.app"
}Error Handling
Invalid API Key
❌ Invalid or revoked API key.
Please check your API key or generate a new one from the MATEX AI platform.Solution: Generate a new API key from the platform.
Rate Limit Exceeded
❌ Rate limit exceeded.
Please wait a moment before trying again.Solution: Wait a few moments or upgrade your plan.
No API Key Configured
❌ No API key configured.
Run: matex config set-key <your-api-key>Solution: Set your API key using the config command.
Examples
Code Generation
matex ask "Create a React component for a login form" --model matexcodexGeneral Questions
matex ask "What are the benefits of TypeScript?"Interactive Debugging
matex chat --model matexcodex
> I'm getting a TypeError in my JavaScript code
> [AI provides solution]
> How can I prevent this in the future?
> [Conversation continues...]Support
- Platform: https://matexai.space/platform
- API Keys: Generate from Settings → API Keys in the platform
- Documentation: https://docs.matexai.space
- Support: [email protected]
License
MIT © Ajay Sharma
Made with ❤️ by the MATEX AI team
