CBRAIN CLI
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
Direzione di ricerca
This is a GSoC project proposal, not a bounded task: the payload names no existing files. Start from the GET /session and GET /users/23 endpoints in the examples, and the credentials file at $HOME/.config/cbrain/credentials.json. The issue asks for the CLI in a separate repo, so confirm that layout with maintainers first. Done would mean cbrain login, whoami and list projects work against a CBRAIN server.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
See GSOC description details as reference, copied below for future iterations and discussion.
-
The CLI project should be developed in a separate GitHub repo. Do not make pull requests on the main CBRAIN project repo.
-
the CLI project’s codebase should contain the minimal set of Python files to implement its core functionality. Do not include external libraries imported by your project, or files installed as part of a virtual environment.
Implementation
Single command ‘cbrain’ that runs in a Unix (Linux/Mac) terminal
The command is a python script that depends on CBRAIN API
libraries to perform its functions
The command has a standard argument structure:
options starts with ‘-’, e.g. -j or --json
other arguments are subcommands and their parameters
Session is maintained in a credentials.json file; advanced
features would be to be able to maintain several distinct
sessions and switch between them?
Examples
These are ‘vision’ examples, not to be taken as the literal product
that this project expects. The developer is free to make adjustments
and make things more convenient/pretty at any levels.
The lines starting with '> ’ represent the terminal’s prompt
and show the ‘cbrain’ command with sample options and argument.
Lines the follow show sample outputs. If these lines are in
parenthesis, it means a description of the output is shown
instead.
> cbrain
(shows the basic usage statement for the command)
> cbrain login
Enter CBRAIN server URL prefix: http://localhost:3000
Enter CBRAIN username: jdoe
Enter CBRAIN password: *********
Connection successful, API token saved in $HOME/.config/cbrain/credentials.json
> cbrain whoami
Current user: jdoe (John Doe) on server http://localhost:3000
> cbrain -v whoami
DEBUG: Found credentials $HOME/.config/cbrain/credentials.json
DEBUG: User in credentials: jdoe on server http://localhost:3000
DEBUG: Token found: a3****b2
DEBUG: Verifying token...
DEBUG: GET /session
DEBUG: Got JSON reply {"user_id":23,"cbrain_api_token":"0123456789abcdeffedcba9876543210"}
DEBUG: GET /users/23
DEBUG: Got JSON reply {"id":23,"login":"jdoe","full_name":"John Doe","email":...}
Current user: jdoe (John Doe) on server http://localhost:3000
> cbrain list projects
ID Type Project Name
-- ----------- ----------------
34 UserProject jdoe
55 WorkProject my_research
> cbrain --json list projects
[
{ "id": 34, "type": "UserProject", "name": "jdoe" },
{ "id": 55, "type": "WorkProject", "name": "myresearch" }
]
> cbrain switch project 34
Current project is now "jdoe" ID=34
> cbrain show project
Current project is "jdoe" ID=34
> cbrain switch project ALL
No current project selected, everything is unfiltered.
> cbrain list files
ID Type File Name
---- ----------- -----------------------
2616 TextFile license.txt
9221 CivetOutput sub-1234_feb24-beluga-1
> cbrain --json list files
(same list but in JSON)
> cbrain list tools
> cbrain list tool_configs
> cbrain list tasks
> cbrain list users
(note: would only list one user unless the user is admin)
> cbrain list data_providers
> cbrain list remote_resources
> cbrain list background_activitites
> cbrain list files where group_id=55 data_provider_id=27
(only shows files based on filters, which are just sent back to the server
as query parameters; cbrain client can validate the keys base on know
allowed filters)
> cbrain list tasks where bourreau_id=45
> cbrain upload 27 TextFile chapter1.txt < chapter1.txt
(27 is the ID of a data provider, the other two args are the type and name; the
content of the file is fed in the unix way from standard input)
> cbrain create task Civet < task_structure.json
> cbrain copy file 2616 27
Background activity ID: 453
(Arguments are file ID, destination data provider ID)
> cbrain move file 2617 27
Background activity ID: 454
(Arguments are file ID, destination data provider ID)
> cbrain --json show background_activity 453
{"id"=>453, "user_id"=>34, "type"=>"BackgroundActivity::CopyFile",
"status"=>"Completed", "items"=>[2616], ... }
> cbrain show file 2616
id: 2616
type: TextFile
name: robot.txt
data_provider: 27
size: 4533
num_files: 1
user_id: 34
group_id: 55
> cbrain show task 12345
> cbrain show tool 13
> cbrain show tool_config 422
> cbrain show data_provider 27
> cbrain show remote_resource 45
(etc etc)
> cbrain logout
The tool should accept 'ls' and 'list', 'mv' and 'move', and 'show' and 'info', as equivalent, for example.
- Lingua principale
- Ruby
- Stelle
- 82
- Fork
- 64
- Merge medio
- 6g 13h
- PR unite (30g)
- 36
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aces/cbrain
-
Admin Bug Priority: Normal
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Admin Refactoring
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
Priority: Normal Refactoring
Difficoltà 3/5 1-2 giorni Idoneità per principianti 71/100
I maintainer di solito rispondono entro 2 giorni
-
Bug Priority: Low User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 57/100
I maintainer di solito rispondono entro 2 giorni
-
Priority: Low User Interface
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 2 giorni
Issue simili
-
`simp environment new` creates rsync/CentOS unconditionally, so the rsync skeleton cannot ship itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
simp/rubygem-simp-cli#244 ·
I maintainer di solito rispondono entro 3 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
erkamyaman/rust-anything#371 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
erkamyaman/safe-anything#45 ·
I maintainer di solito rispondono entro 1 giorno
-
bug task
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
aces/cbrain-plugins-neuro#398 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100