c18932245f
<!-- Raise an issue to propose your change (https://github.com/cvat-ai/cvat/issues). It helps to avoid duplication of efforts from multiple independent contributors. Discuss your ideas with maintainers to be sure that changes will be approved and merged. Read the [Contribution guide](https://docs.cvat.ai/docs/contributing/). --> <!-- Provide a general summary of your changes in the Title above --> ### Motivation and context This PR adds file-based profile creation: - `cvat-cli profile create --file <path>` - Supports plain-text PAT files - Supports JSON envelopes with `token`, optional `server`, and optional `name` - Explicit `--name` and `--server-host` override envelope values - A complete JSON envelope can create a profile without extra CLI arguments It also includes: - Tests for plain-file import, JSON import, and precedence rules - CLI/SDK/profile documentation updates - A changelog entry for `--file` ### How has this been tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> ### Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. If an item isn't applicable for some reason, then ~~explicitly strikethrough~~ the whole line. If you don't do that, GitHub will show incorrect progress for the pull request. If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I submit my changes into the `develop` branch - [x] I have created a changelog fragment <!-- see top comment in CHANGELOG.md --> - [x] I have updated the documentation accordingly - [x] I have added tests to cover my changes - [x] I have linked related issues (see [GitHub docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)) ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. --------- Co-authored-by: Maxim Zhiltsov <maxim@cvat.ai>
Command-line client for CVAT
A simple command line interface for working with CVAT. At the moment it implements a basic feature set but may serve as the starting point for a more comprehensive CVAT administration tool in the future.
The following subcommands are supported:
-
Projects:
backup- back up a projectcreate- create a new projectcreate-from-backup- create a project from a backup filedelete- delete projectsexport-dataset- export a project as a datasetimport-dataset- import annotations into a project from a datasetls- list all projects
-
Tasks:
create- create a new taskcreate-from-backup- create a task from a backup filedelete- delete tasksls- list all tasksframes- download frames from a taskexport-dataset- export a task as a datasetimport-dataset- import annotations into a task from a datasetbackup- back up a taskauto-annotate- automatically annotate a task using a local function
-
Functions (Enterprise/Cloud only):
create-native- create a function that can be powered by an agentdelete- delete a functionrun-agent- process requests for a native function
Installation
pip install cvat-cli
Usage
The general form of a CLI command is:
$ cvat-cli <common options> <resource> <action> <options>
where:
<common options>are options shared between all subcommands;<resource>is a CVAT resource, such astask;<action>is the action to do with the resource, such ascreate;<options>is any options specific to a particular resource and action.
You can list available subcommands and options using the --help option:
$ cvat-cli --help # get help on available common options and resources
$ cvat-cli <resource> --help # get help on actions for the given resource
$ cvat-cli <resource> <action> --help # get help on action-specific options
Examples
Create a task with local images:
cvat-cli --auth user task create
--labels '[{"name": "car"}, {"name": "person"}]'
"test_task"
"local"
"image1.jpg" "image2.jpg"
List tasks on a custom server with auth:
cvat-cli --auth admin:password \
--server-host cvat.my.server.com --server-port 30123 \
task ls