Code-first development with Modus
For developers who prefer working with code, Modus provides a complete local development environment. This approach gives you full control over your App’s structure, version control integration, and the ability to work within your existing development tools.Setting up local development
Install the Modus CLI to start building Apps locally:- Agent definitions and configurations
- Function definitions for custom tools
- Model integrations and connections
- Environment configuration
- Testing framework
Local development workflow
When developing locally, you get the full Modus runtime experience:- Hot reload for rapid iteration with fast refresh
- Built-in debugging with full observability
- API Explorer for testing functions and agents interactively
- Model experimentation with easy model swapping via Model Router
- Environment management with
.env
files
Local development environment
When you runmodus dev
, you get:
- Local server running at
http://localhost:8686
- API Explorer at
http://localhost:8686/explorer
for interactive testing - Automatic compilation of your Go or AssemblyScript code to WebAssembly
- Fast refresh that preserves app state during development
- Environment variable substitution from
.env.dev.local
files
Code structure
Apps follow the Modus project structure that scales from simple functions to complex agent systems:Environment and secrets management
Modus handles environment variables and secrets securely:modus.json
.env.dev.local
:
.env.dev.local
{{API_KEY}}
with MODUS_EXTERNAL_API_API_KEY
following the naming convention: MODUS_<CONNECTION_NAME>_<PLACEHOLDER>
.
Using Hypermode-hosted models
To access Hypermode’s Model Router and hosted models locally:Collaborative development
Both approaches support team collaboration:Code-first teams
- Standard Git workflows with branching and pull requests
- Shared development environments
- Code reviews for agent logic and function implementations
- Automated testing and CI/CD integration
Mixed teams
- Subject matter experts build and refine using Threads (see our Threads documentation)
- Developers enhance and ship Modus code
- Seamless handoff between exploration and implementation
- Shared testing environments using
modus dev
Testing and debugging
Hypermode provides comprehensive testing tools for both development approaches:Built-in testing with Modus
- API Explorer: Interactive testing of functions and agents
- Agent behavior tests: Verify reasoning and decision-making
- Function integration tests: Test external API calls and data processing
- Memory tests: Validate state persistence and retrieval
- End-to-end scenarios: Test complete workflows
Observability and debugging
- Execution tracing: See every step of agent reasoning
- Function call monitoring: Track all external interactions
- Memory access logs: Understand how agents use context
- Performance metrics: Monitor response times and resource usage
- Real-time logs: Debug issues as they happen during development
Environment management
Apps support multiple environments throughout development:Local development
- Full-featured Modus runtime with
modus dev
- Mock external services for testing
- Hot reload and instant feedback
- Local memory persistence
- API Explorer for interactive testing