User Guide¶
Learn how to configure and use Canvas CLI effectively.
Topics¶
-
Configuration
Configure Canvas CLI for your environment, including multiple instances
-
Output Formats
Learn about output formats and filtering options
-
Shell Completion
Set up tab completion for your shell
-
Command Aliases
Create shortcuts for frequently used commands
-
Context Management
Set default values for course, assignment, and user IDs
Key Concepts¶
Course Context¶
Most commands require a course context. You can specify this with the --course-id flag:
Output Formats¶
Canvas CLI supports multiple output formats:
- table (default) - Human-readable table format
- json - JSON for scripting and automation
- yaml - YAML format
- csv - CSV for spreadsheet import
Caching¶
Canvas CLI caches API responses for better performance. You can:
- Disable caching with
--no-cache - Clear the cache with
canvas cache clear - View cache statistics with
canvas cache stats
Masquerading¶
Administrators can act as other users with the --as-user flag:
This requires masquerading permissions in Canvas.
Dry-Run Mode¶
Preview API calls without executing them using the --dry-run flag:
This prints the equivalent curl command, which is useful for:
- Debugging - See exactly what API call would be made
- Learning - Understand the Canvas API structure
- Scripting - Generate curl commands for other tools
By default, tokens are redacted as [REDACTED]. Use --show-token to see the actual token:
See the Scripting Tutorial for more examples.