Skip to content

Commit

Permalink
docs(cli): make examples more easily navigable by generating TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Jan 8, 2022
1 parent 55c67d1 commit f33c523
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/cli-examples.rst
Expand Up @@ -6,6 +6,9 @@ CLI examples

For a complete list of objects and actions available, see :doc:`/cli-objects`.

Projects
--------

List the projects (paginated):

.. code-block:: console
Expand Down Expand Up @@ -42,12 +45,18 @@ Get a specific project (id 2):
$ gitlab project get --id 2
Users
-----

Get a specific user by id:

.. code-block:: console
$ gitlab user get --id 3
Deploy tokens
-------------

Create a deploy token for a project:

.. code-block:: console
Expand All @@ -61,6 +70,9 @@ List deploy tokens for a group:
$ gitlab -v group-deploy-token list --group-id 3
Packages
--------

List packages for a project:

.. code-block:: console
Expand Down Expand Up @@ -99,12 +111,18 @@ Download a project's generic package:
$ gitlab generic-package download --project-id 1 --package-name hello-world \
--package-version v1.0.0 --file-name hello.tar.gz > /path/to/hello.tar.gz
Issues
------

Get a list of issues for this project:

.. code-block:: console
$ gitlab project-issue list --project-id 2
Snippets
--------

Delete a snippet (id 3):

.. code-block:: console
Expand All @@ -128,6 +146,9 @@ Create a snippet:
$ gitlab project-snippet create --project-id 2 --title "the title" \
--file-name "the name" --code "the code"
Commits
-------

Get a specific project commit by its SHA id:

.. code-block:: console
Expand All @@ -149,12 +170,18 @@ Define the status of a commit (as would be done from a CI tool for example):
--target-url http://server/build/123 \
--description "Jenkins build succeeded"
Artifacts
---------

Download the artifacts zip archive of a job:

.. code-block:: console
$ gitlab project-job artifacts --id 10 --project-id 1 > artifacts.zip
Other
-----

Use sudo to act as another user (admin only):

.. code-block:: console
Expand Down

0 comments on commit f33c523

Please sign in to comment.