Skip to content

Commit ebdcffd

Browse files
Document runner CLI sub-commands (#9515)
* Documenting sub-command * Documenting CLI sub-commands * Documenting token-related CLI sub-commands * Mentioning shorthand * Using internal link * Removing a few words too many --------- Co-authored-by: Rosie Yohannan <[email protected]>
1 parent 9486877 commit ebdcffd

File tree

1 file changed

+128
-0
lines changed

1 file changed

+128
-0
lines changed

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

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,134 @@ 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+
[#runner-management]
334+
== Runner management
335+
336+
You can operate on your self-hosted runners using the CLI.
337+
338+
=== List runner instances
339+
340+
Use the `runner instance list` sub-command to get a list of your runner instances.
341+
342+
For your namespace:
343+
344+
[,shell]
345+
----
346+
circleci runner instance list <namespace> [flags]
347+
----
348+
349+
For a specific resource class:
350+
351+
[,shell]
352+
----
353+
circleci runner instance list <namespace/resource-class> [flags]
354+
----
355+
356+
- `<namespace>` is the namespace claimed for your organization. You can see your namespace on the self-hosted runners inventory page in the CircleCI web app, by selecting **Self-Hosted Runners** in the sidebar.
357+
358+
- `<resource-class>` is the label for the resource class of the specific pool of self-hosted runners. You can find the resource class for all your pools in the link:https://app.circleci.com[CircleCI web app], by selecting **Self-Hosted Runners** in the sidebar.
359+
360+
To find out more on namespace and resource class, see the xref:execution-runner:runner-concepts.adoc#namespaces-and-resource-classes[Self-hosted runner concepts] page.
361+
362+
For full details on the `instance list` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_instance_list.html[CLI docs].
363+
364+
=== Create a resource class
365+
366+
Use the `resource-class create` sub-command to add a new resource class.
367+
368+
[,shell]
369+
----
370+
circleci runner instance create <namespace/resource-class> <description> [flags]
371+
----
372+
373+
- `<namespace>` is the namespace claimed for your organization. You can see your namespace on the self-hosted runners inventory page in the CircleCI web app, by selecting **Self-Hosted Runners** in the sidebar.
374+
375+
- `<resource-class>` is the label for the resource class of the specific pool of self-hosted runners. You can find the resource class for all your pools in the link:https://app.circleci.com[CircleCI web app], by selecting **Self-Hosted Runners** in the sidebar.
376+
377+
- `<description>` is the argument that allows you to provide a description for the resource class. It must be enclosed in double-quotes.
378+
379+
For full details on the `resource-class create` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_resource-class_create.html[CLI docs].
380+
381+
=== Delete a resource class
382+
383+
Use the `resource-class delete` sub-command to delete an existing resource class.
384+
385+
[,shell]
386+
----
387+
circleci runner resource-class delete <namespace/resource-class> [flags]
388+
----
389+
390+
- `<namespace>` is the namespace claimed for your organization. You can see your namespace on the self-hosted runners inventory page in the CircleCI web app, by selecting **Self-Hosted Runners** in the sidebar.
391+
392+
- `<resource-class>` is the label for the resource class of the specific pool of self-hosted runners. You can find the resource class for all your pools in the link:https://app.circleci.com[CircleCI web app], by selecting **Self-Hosted Runners** in the sidebar.
393+
394+
For full details on the `resource-class delete` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_resource-class_delete.html[CLI docs].
395+
396+
=== List resource classes
397+
398+
Use the `resource-class list` sub-command to list all resource classes for your namespace.
399+
400+
[,shell]
401+
----
402+
circleci runner resource-class list <namespace> [flags]
403+
----
404+
405+
Alternatively, you can use the shorthand `ls`, instead of `list`.
406+
407+
408+
- `<namespace>` is the namespace claimed for your organization. You can see your namespace on the self-hosted runners inventory page in the CircleCI web app, by selecting **Self-Hosted Runners** in the sidebar.
409+
410+
For full details on the `resource-class list` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_resource-class_list.html[CLI docs].
411+
412+
=== Create a token for a resource class
413+
414+
Use the `token create` sub-command to create a token for a resource class.
415+
416+
[,shell]
417+
----
418+
circleci runner token create <namespace/resource-class> <nickname> [flags]
419+
----
420+
421+
- `<namespace>` is the namespace claimed for your organization. You can see your namespace on the self-hosted runners inventory page in the CircleCI web app, by selecting **Self-Hosted Runners** in the sidebar.
422+
423+
- `<resource-class>` is the name of the resource class for the specific pool of self-hosted runners. You can find the resource class for all your pools in the link:https://app.circleci.com[CircleCI web app], by selecting **Self-Hosted Runners** in the sidebar.
424+
425+
- `<nickname>` refers to a human-readable name you assign to the token.
426+
427+
For full details on the `resource-class token create` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_token_create.html[CLI docs].
428+
429+
430+
=== List tokens for a resource class
431+
432+
Use the `token list` sub-command to list all tokens for a resource class.
433+
434+
[,shell]
435+
----
436+
circleci runner token list <namespace/resource-class> [flags]
437+
----
438+
439+
Alternatively, you can use the shorthand `ls`, instead of `list`.
440+
441+
- `<namespace>` is the namespace claimed for your organization. You can see your namespace on the self-hosted runners inventory page in the CircleCI web app, by selecting **Self-Hosted Runners** in the sidebar.
442+
443+
- `<resource-class>` is the name of the resource class for the specific pool of self-hosted runners. You can find the resource class for all your pools in the link:https://app.circleci.com[CircleCI web app], by selecting **Self-Hosted Runners** in the sidebar.
444+
445+
For full details on the `token list` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_token_list.html[CLI docs].
446+
447+
=== Delete a token
448+
449+
Use the `token delete` sub-command to delete a token for a resource class.
450+
451+
[,shell]
452+
----
453+
circleci runner token delete <token-id> [flags]
454+
----
455+
456+
- `<token-id>` is the ID of the token to delete. You can find the token ID by running the `token list` sub-command, described above.
457+
458+
For full details on the `token delete` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_runner_token_delete.html[CLI docs].
459+
460+
333461
[#project-management]
334462
== Project management
335463

0 commit comments

Comments
 (0)