Skip to content

Commit 57f38d2

Browse files
Documenting CLI project-oriented sub-commands (#204)
* Adding description for CLI project-oriented sub-commands * Implementing review suggestions * Adding sub-headings for all sub-commands * Adding details about the arguments * Clarifying sub-commands arguments * Fixing formatting * Improving layout --------- Co-authored-by: Rosie Yohannan <[email protected]>
1 parent 31d15b3 commit 57f38d2

File tree

1 file changed

+84
-2
lines changed

1 file changed

+84
-2
lines changed

docs/guides/modules/toolkit/pages/how-to-use-the-circleci-local-cli.adoc

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ circleci config process .circleci/config.yml > process.yml
272272
circleci local execute -c process.yml <job-name>
273273
----
274274
+
275-
If you are using `version: 2` configuration, you can simply run:
275+
If you are using `version: 2` configuration, you can run:
276276
+
277277
[,shell]
278278
----
@@ -330,6 +330,88 @@ circleci build -e VAR1=FOO -e VAR2=BAR
330330

331331
The CircleCI CLI is used for some advanced features during job runs, for example xref:optimize:use-the-circleci-cli-to-split-tests.adoc[test splitting] for build time optimization.
332332

333+
[#project-management]
334+
== Project management
335+
336+
The CircleCI CLI allows you to execute several project-oriented actions.
337+
338+
=== Create a new project
339+
340+
NOTE: This command only applies to GitLab or GitHub App organizations (Organization slug starts with `circleci` followed by a UUID. For example, `circleci/34R3kN5RtfEE7v4sa4nWAU`. You can find your organization slug under menu:Organization Settings[Overview]).
341+
342+
Use the `create` sub-command to create a new project.
343+
344+
[,shell]
345+
----
346+
circleci project create <vcs-type> <org-id> [flags]
347+
----
348+
349+
- `<vcs-type>` depends on the type of integration for your organization. This command only supports the `circleci` VCS type.
350+
351+
- `<org-id>` is the ID of the organization associated with the project. You can find it from the CircleCI web app under menu:Organization Settings[Overview].
352+
353+
- `--name` is the flag that allows you to provide the project name. If not provided, you will be prompted to enter it.
354+
355+
For full details on the `create` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_project_create.html[CLI docs].
356+
357+
358+
=== Create an environment variable for a project
359+
360+
Use the `secret create` sub-command to create an environment variable for a project:
361+
362+
[,shell]
363+
----
364+
circleci project secret create <vcs-type> <org-id> <project-id> <env-name> [flags]
365+
----
366+
367+
- `<vcs-type>` depends on the type of integration for your organization. For projects that use GitLab or GitHub App, use `circleci` as `vcs-type`.
368+
369+
- `<org-id>` is the ID of the organization associated with the project. You can find it from the CircleCI web app under menu:Organization Settings[Overview].
370+
371+
- `<project-id>` is the ID of the project associated with the project. You can find it from the CircleCI web app under menu:Project Settings[Overview].
372+
373+
- `<env-name>` is the name of the environment variable to create.
374+
375+
- `--env-value` is the flag that allows you to provide the value of the environment variable. If not provided, you will be prompted to enter it.
376+
377+
For full details on the `secret create` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_project_secret_create.html[CLI docs].
378+
379+
=== List all environment variables for a project
380+
381+
Use the `secret list` sub-command to list all environment variables for a project:
382+
383+
[,shell]
384+
----
385+
circleci project secret list <vcs-type> <org-id> <project-id>
386+
----
387+
388+
- `<vcs-type>` depends on the type of integration for your organization. For projects that use GitLab or GitHub App, use `circleci` as `vcs-type`.
389+
390+
- `<org-id>` is the ID of the organization associated with the project. You can find it from the CircleCI web app under menu:Organization Settings[Overview].
391+
392+
- `<project-id>` is the ID of the project associated with the project. You can find it from the CircleCI web app under menu:Project Settings[Overview].
393+
394+
For full details on the `secret list` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_project_secret_list.html[CLI docs].
395+
396+
=== Purge Docker Layer Cache for a project
397+
398+
Purging the xref:optimize:docker-layer-caching.adoc[Docker Layer Cache] means removing previously stored Docker image layers so that future builds will not reuse those cached layers. This forces CircleCI to rebuild Docker images from scratch, rather than leveraging layers from earlier builds to speed up the process.
399+
400+
Use the `dlc purge` sub-command to purge Docker Layer Cache for a project:
401+
402+
[,shell]
403+
----
404+
circleci dlc purge <vcs-type> <org-id> <project-id>
405+
----
406+
407+
- `<vcs-type>` depends on the type of integration for your organization. For projects that use GitLab or GitHub App, use `circleci` as `vcs-type`.
408+
409+
- `<org-id>` is the ID of the organization associated with the project. You can find it from the CircleCI web app under menu:Organization Settings[Overview].
410+
411+
- `<project-id>` is the ID of the project associated with the project. You can find it from the CircleCI web app under menu:Project Settings[Overview].
412+
413+
For full details on the `dlc purge` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_project_dlc.html[CLI docs].
414+
333415
[#context-management]
334416
== Context management
335417

@@ -342,7 +424,7 @@ xref:security:contexts.adoc[Contexts] provide a mechanism for securing and shari
342424
- `show` - Show a context
343425
- `store-secret` - Store a new environment variable in the named context
344426

345-
The above list are "sub-commands" in the CLI, which would be executed like so:
427+
The above list are "sub-commands" in the CLI, which are executed like so:
346428

347429
[,shell]
348430
----

0 commit comments

Comments
 (0)