Squid CLI
The Squid CLI is a powerful command-line tool for scaffolding, managing, and deploying Squid indexers. It streamlines the development workflow from project creation to production deployment.The CLI provides a unified interface for all Squid operations, from local
development to cloud deployment.
Installation
Install the Squid CLI globally:Verify installation by running
sqd --versionCore Commands
Project Management
Initialize New Project
Create a new Squid project from templates or repositories:Templates include pre-configured examples for different blockchain types (EVM,
Substrate, Solana, etc.).
Project Development
Essential commands for development workflow:Process Management
Run Processor
Start and manage your indexer processor:Database Operations
Manage database migrations and schema changes:Always test migrations locally before deploying to production.
Deployment
SQD Cloud Deployment
Deploy your indexer to SQD Cloud:You need to authenticate with SQD Cloud before deploying. Use
sqd auth to
set up authentication.Configuration
squid.yaml
The main configuration file for your Squid project:squid.yaml
The
squid.yaml file defines your project’s build and deployment
configuration. It’s automatically generated when you create a new project.Environment Variables
Configure your development and production environments:.env
Templates
Available Templates
Choose from pre-built templates for different blockchain types:EVM Template
Basic EVM indexer template for Ethereum and EVM-compatible chains
Substrate Template
Substrate blockchain indexer for Polkadot, Kusama, and Substrate chains
Solana Template
Solana blockchain indexer for Solana programs and transactions
Multi-chain Template
Index multiple blockchains in a single project
Custom Templates
Use your own templates for specialized use cases:Advanced Usage
Custom Commands
Define custom commands incommands.json for project-specific workflows:
commands.json
Custom commands are executed using
sqd <command-name> and can include any shell commands or scripts.Multi-environment Setup
Configure different environments for development, staging, and production:Troubleshooting
Common Issues
Permission denied errors
Permission denied errors
Ensure you have proper permissions and are logged in to SQD Cloud:
Check that your SQD Cloud account has the necessary permissions for the organization.
Build failures
Build failures
Clear cache and rebuild:
bash sqd clean sqd build Database connection issues
Database connection issues
Check your environment variables and database status: ```bash sqd db:status
Debug Mode
Enable detailed logging for troubleshooting:Debug mode provides detailed information about CLI operations, which is
helpful for diagnosing issues.
Best Practices
Follow these best practices for effective CLI usage:- Version Control: Use version control for your Squid projects to track changes and collaborate
- Local Testing: Always test locally before deploying to SQD Cloud
- Environment Management: Use environment-specific configurations for different deployment stages
- CLI Updates: Regularly update CLI to the latest version for new features and bug fixes
- Monitoring: Monitor deployment logs for issues and performance insights
- Security: Never commit sensitive credentials to version control
CLI Reference
Global Options
| Option | Description |
|---|---|
--help, -h | Show help information |
--version, -V | Show CLI version |
--verbose, -v | Enable verbose output |
--quiet, -q | Suppress output |
Command Categories
Project Commands
init- Initialize new projectbuild- Build projectclean- Clean build artifacts
Database Commands
migration:*- Manage migrations -codegen- Generate TypeORM models
Development Commands
serve:*- Start development servers -process- Run processor
Deployment Commands
deploy- Deploy to SQD Cloudauth- Manage authentication
Complete Command Reference
For detailed information about all available commands:Each command also supports
--help for specific usage information, e.g., sqd deploy --help.
