A command-line interface tool for running tests and submitting assignments for DotCodeSchool courses.
The DotCodeSchool CLI is a test runner that helps students work on DotCodeSchool course assignments. It provides functionality to run tests locally, list available tests, and submit your work to the DotCodeSchool platform.
- 🧪 Test Runner: Run course tests locally with various modes (single test, all tests, or staggered mode)
- 📋 Test Listing: View all available tests for your course
- 🚀 Assignment Submission: Submit your work directly to DotCodeSchool
- 🔄 State Management: Persistent state tracking using an embedded database
- 🌐 Backend Integration: Seamless integration with DotCodeSchool's backend API
- 🖥️ Cross-Platform: Support for macOS and Linux (both amd64 and arm64 architectures)
Use the installation script to automatically download and install the latest version:
curl -sSL https://raw.githubusercontent.com/dotcodeschool/cli/main/install.sh | sh
You can customize the installation:
# Install a specific version
DOTCODESCHOOL_CLI_VERSION=v0.1.0 curl -sSL https://raw.githubusercontent.com/dotcodeschool/cli/main/install.sh | sh
# Install to a custom location
INSTALL_DIR=/usr/local/bin curl -sSL https://raw.githubusercontent.com/dotcodeschool/cli/main/install.sh | sh
- Download the appropriate binary for your platform from the releases page
- Extract the archive:
tar -xzf v0.1.0_<os>_<arch>.tar.gz
- Move the binary to your PATH:
sudo mv dotcodeschool /usr/local/bin/ chmod +x /usr/local/bin/dotcodeschool
Run tests in staggered mode (default):
dotcodeschool test
Run all tests at once:
dotcodeschool test --all
Run a specific test by name:
dotcodeschool test <test-name>
Keep the test environment after running (useful for debugging):
dotcodeschool test --keep
View all tests available for your course:
dotcodeschool test --list
Submit the current commit to DotCodeSchool:
dotcodeschool submit
Create an empty commit and submit it:
dotcodeschool submit --empty
Specify a custom database path:
dotcodeschool --db /path/to/database test
- Rust 1.56 or later
- OpenSSL development headers (for building)
- For cross-platform builds: Docker and cross
cargo build
cargo build --release
cargo build --profile production
To build for all supported platforms (requires Docker):
./build.sh
This will create release archives for:
- macOS (x86_64 and ARM64)
- Linux (x86_64 and ARM64)
The built binaries will be in the releases/
directory with SHA256 checksums.
Platform | Architecture | Status |
---|---|---|
macOS | x86_64 (Intel) | ✅ Supported |
macOS | ARM64 (Apple Silicon) | ✅ Supported |
Linux | x86_64 | ✅ Supported |
Linux | ARM64 | ✅ Supported |
The CLI uses a local database (.dcs.db
by default) to store state information. Logs are written to .dcs.log
in the current directory.
cli/
├── src/
│ ├── main.rs # Entry point and CLI argument parsing
│ ├── monitor.rs # State machine and workflow coordination
│ ├── runner/ # Test execution logic
│ ├── lister/ # Test listing functionality
│ ├── validator/ # Validation logic
│ ├── parsing/ # Configuration and data parsing
│ ├── db.rs # Database operations
│ ├── models.rs # Data models
│ ├── constants.rs # Application constants
│ └── str_res.rs # String resources
├── Cargo.toml # Rust dependencies and configuration
├── build.sh # Cross-platform build script
└── install.sh # Installation script
Key dependencies include:
clap
- CLI argument parsingsled
- Embedded databaseserde
- Serialization/deserializationreqwest
- HTTP client for API communicationgit2
- Git operationscolored
- Terminal output coloringindicatif
- Progress bars
Contributions are welcome! Please feel free to submit a Pull Request.
For issues, questions, or feature requests, please open an issue on GitHub.