Get last created workspace of user via CLI
From https://discord.com/channels/747933592273027093/971231372373033030/1245469675895394325 - @joshiscool
---
Hi, is there any easy way to see when a workspace is created? I know its in the json output of coder ls but it would be nice if it was in a more accisble place.
an engineer on my team creates alot of workspaces and wants to open the latest one she created, basically.
I told her to run
But this feels subopitmal
16 Replies
Category: Help needed
Product: Coder OSS (v2)
What platform are you hosting Coder OSS (v2) on?
thanks!!
other than that, I think your best bet would be to use the API
for sure
i'm looking at the docs to see what can be done
thank you!!
okay, turns out that the only relevant API endpoint (List Endpoints) is already the one that
coder ls
usesthough apparently you can pass a query to
coder ls
, maybe this can help narrow the search a bitWorkspaces - Coder Docs
Learn about Coder workspaces.
it doesn't really seem that we can "get latest workspace", we can only really sort by workspace owner, template name and workspace status
yeah, no prob, I think the CLI trick is good enough for now
thanks
oh actually
unless she has favorites, the running workspaces are bumped at the top of the list
meh -- still requires some filtering so might aswell use
created_at
maybe this is a bit better :
![No description](https://cdn.answeroverflow.com/1245473869054083163/image.png)
thanks!!
let us know if you figure out something better :-)
i will mark this thread as resolved