Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 77 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
A command-line interface to a CBRAIN service
============================================

This repository contains a UNIX command-line interface (CLI) for [CBRAIN](https://github.com/aces/cbrain).
This repository contains a UNIX command-line interface (CLI) for [CBRAIN](https://github.com/aces/cbrain), a web-based neuroinformatics platform designed for collaborative brain imaging research. CBRAIN provides researchers with distributed computational resources, data management capabilities, and a framework for running neuroscience analysis pipelines across multiple high-performance computing environments.

The interface is implemented in Python using only standard libraries - no external dependencies required.
>The interface is implemented in Python using only standard libraries - no external dependencies required.

The main command is called "cbrain" and as is typical for such clients, works
with a set of subcommand and options (e.g. "cbrain file list -j") such as:
```bash
cbrain file list
cbrain project show
cbrain --json dataprovider list
```

## CBRAIN Access Options

Expand All @@ -26,7 +19,7 @@ There are two main ways to access CBRAIN:

2. **Custom/Development Setup**
- Deploy CBRAIN on your lab cluster, cloud, or virtual machine
- Suitable for organizations wanting their own CBRAIN instance
- Suitable for organizations that require their own CBRAIN instance or which prefer to host CBRAIN themselves due to legal or corporate requirements
- Local installation only needed for:
- CLI software developers
- Power users developing/debugging custom CLI scripts
Expand Down Expand Up @@ -77,12 +70,85 @@ When prompted for "Enter CBRAIN server URL prefix", enter:
This CLI interfaces with the CBRAIN REST API. For complete API documentation and specifications, refer to:
- [CBRAIN API Documentation (Swagger)](https://app.swaggerhub.com/apis/prioux/CBRAIN/7.0.0)

## CLI Usage

The main command is called "cbrain" and as is typical for such clients, works
with a set of subcommand and options.

### Basic Usage

To utilize the Cbrain cli, you can execute variations of the following command in your terminal:

```
cbrain -h # view the cli options
cbrain [options] <MODEL> <ACTION> [id_or_args]
```
**Output Formats:**
- `--json` or `-j`: JSON format output
- `--jsonl` or `-jl`: JSON Lines format (one JSON object per line)

## Available Commands
- `version` - Show CLI version
- `login` - Login to CBRAIN
- `logout` - Logout from CBRAIN
- `whoami` - Show current session
- `file` - File operations
- `dataprovider` - Data provider operations
- `project` - Project operations
- `tool` - Tool operations
- `tool-config` - Tool configuration operations
- `tag` - Tag operations
- `background` - Background activity operations
- `task` - Task operations
- `remote-resource` - Remote resource operations

## Command Examples

<p align="center">
<img src="https://github.com/user-attachments/assets/ae3fe36d-a83d-4cbf-a245-c9242c60c9ff" alt="List, Total and Get GIF" width="500" height="300">
</p>

> <details><summary> Used cmds in the above GIF</summary>
>
> - `./cbrain project switch 2`
> - `./cbrain project show`
> - `./cbrain tool show 2`
> - `./cbrain dataprovider show 4`
> - `./cbrain file show 4`
> - `./cbrain background show 15`
> - `./cbrain remote-resource show 2`
> - `./cbrain tag show 17`
> - `./cbrain task show 1`
>
> </details>

<p align="center">
<img src="https://github.com/user-attachments/assets/21ebd917-e84b-4616-bcfa-6c2802220efe" alt="List, Total and Get GIF" width="500" height="300">
</p>

> <details><summary> Used cmds in the above GIF</summary>
>
> - `./cbrain file list`
> - `./cbrain project list`
> - `./cbrain background list`
> - `./cbrain dataprovider list`
> - `./cbrain remote-resource list`
> - `./cbrain tag list`
> - `./cbrain task list`
> - `./cbrain task list bourreau-id 3`
>
> </details>

## Development

This is part of a GSoC (Google Summer of Code) project sponsored by [INCF](https://www.incf.org/).
This is part of [**a GSoC (Google Summer of Code) 2025** project](https://summerofcode.withgoogle.com/programs/2025/projects/1An4Dp8N) sponsored by [INCF](https://www.incf.org/).

The lead developer is [axif0](https://github.com/axif0), mentored by the developers of the CBRAIN project.

### Continuous Integration

Continuous Integration (CI) tests and framework were initially configured by P. Rioux, providing automated validation of the codebase. This infrastructure follows best open source practices and ensures code quality through automated testing.

## License

See [LICENSE](LICENSE) file for details.
Loading