Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: add section on how to retrieve user list#17798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
EdwardAngert merged 6 commits intomainfromexport-coder-users
May 13, 2025

Conversation

EdwardAngert
Copy link
Contributor

@EdwardAngertEdwardAngert commentedMay 13, 2025
edited
Loading

previews

followup to slack thread:

Tim
what's the best way for customers to export a list of Coder users?

@ericpaulsen
the/api/v2/users API route returns all users in the deployment (along with other information - email, status, username, etc.). fromhttps://coder.com/docs/reference/api/users#get-users

  • adds an easy-to-find section to the admin/users doc
  • updates the cli commands with short descriptions

@EdwardAngertEdwardAngert self-assigned thisMay 13, 2025
@EdwardAngertEdwardAngert added the docsArea: coder.com/docs labelMay 13, 2025
Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think we should encourage CLI usage over API

EdwardAngert reacted with thumbs up emoji
Comment on lines 209 to 237

## Use the Coder API to retrieve a list of users

Use the [Coder API](../../reference/api/users.md#get-users) to retrieve a full list of users on your Coder deployment:

```shell
curl -X GET http://coder-server:8080/api/v2/users \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```

You can also filter your results based on the `organization_id` with:

```shell
curl -X GET 'http://coder-server:8080/api/v2/users?organization_id=Example-Org' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```

### Export a list of users to a CSV file

You can use [jq](https://jqlang.org/) to process the JSON response and export the results to a CSV file:

```shell
curl -X GET http://coder-server:8080/api/v2/users \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY' | \
jq -r '.users | (map(keys) | add | unique) as $cols | $cols, (.[] | [.[$cols[]]] | @csv)' > users.csv
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

coder users list> users.txt

This does the same thing

EdwardAngert reacted with hooray emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We already have a documentation page for that.https://coder.com/docs/reference/cli/users_list

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would rather update CLI command to add description

Use:"list",
by adding theShort: "Prints the users list.", field

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

An example use case is here:

Short:short,

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm happy to switch it to the Coder CLI command and can also PR to the CLI source docs, but I do want to keep the heading in this doc, where I think it's more likely to be found and we can explain the examples better

++ to including a better description oflist in both:

matifali reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think that with a better-described CLI command, our admin documentation could be pretty simple. We can demonstrate a single use case for exporting list to a CSV file. There is no need to cover all use cases in admin docs, as they are already covered in CLI docs.

WDYT?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm torn - I agree, I don't think we need to catch every possibility from the same page.

but generally, I think if someone's looking for it, we should make it easy to find, and I think the CLI is almost thatif someone already knows how they're trying to do it ("I want to use the CLI to get a list of users, what command do I use"), but in some cases, I think we want to catch people from web/docs search who just know they want to "list users" and don't know where they'd do that

it'd be really nice to check back on these pages in a few months to see if they're getting more traffic 🤔

@ericpaulsen
Copy link
Member

looks great, thanks@EdwardAngert for filling this gap, and@matifali for the feedback.

Copy link
Member

@matifalimatifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

That's great Edward. Left a few more suggestions.

EdwardAngertand others added2 commitsMay 13, 2025 16:33
Co-authored-by: M Atif Ali <atif@coder.com>
Co-authored-by: M Atif Ali <atif@coder.com>
@EdwardAngertEdwardAngertenabled auto-merge (squash)May 13, 2025 20:40
@EdwardAngertEdwardAngert merged commitf9817af intomainMay 13, 2025
36 checks passed
@EdwardAngertEdwardAngert deleted the export-coder-users branchMay 13, 2025 20:48
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 13, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@ericpaulsenericpaulsenericpaulsen approved these changes

@matifalimatifalimatifali approved these changes

Assignees

@EdwardAngertEdwardAngert

Labels
docsArea: coder.com/docs
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@EdwardAngert@ericpaulsen@matifali

[8]ページ先頭

©2009-2025 Movatter.jp