CLI User Guide
AtomGit CLI is a command-line tool for interacting with the AtomGit platform, supporting operations such as uploading and downloading models and datasets. The tool is developed based on the OpenMind Hub SDK and is configured to connect to the AtomGit API endpoint.
Features
- User authentication and login management
- Git Integration: Automatically configure Git credentials, support standard Git commands
- Support for creating model and dataset repositories
- Batch upload of files and directories
- Download repository content
- Colorful terminal output
- Upload and download progress display
- Configuration file management
Installation
Install from source
git clone https://gitcode.com/gitcode-ai/gitcode_cli.git
cd gitcode_cli
pip install -e .
Install using pip
pip install gitcode
Usage
1. Login
First, you need to log in to the AtomGit platform:
gitcode login
The system will prompt you to enter an access token (obtained from the AtomGit platform).
Git Integration Feature: After successful login, the tool will automatically configure the Git credential helper, allowing you to directly use standard Git commands to operate AtomGit repositories without re-entering the token. The credential helper will automatically retrieve your real username from the AtomGit API for Git authentication:
# After logging in, these Git commands will automatically use the saved token
# Supports two domain name formats
git clone https://gitcode.com/username/repo-name.git
git clone https://hub.gitcode.com/username/repo-name.git
git push origin main
git pull origin main
2. Upload Files
Upload Model
gitcode upload ./your-model-dir --repo-id your-username/your-model-name
Upload Dataset
gitcode upload ./your-dataset-dir --repo-id your-username/your-dataset-name
Upload a Single File
gitcode upload ./model.bin --repo-id your-username/your-model-name