-
Notifications
You must be signed in to change notification settings - Fork 19
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better CLI API #554
Comments
Indeed, CLI would need more love and has a lot of opportunities to improve the DX! Two points from my side:
|
Thank you for a great proposal, @barjin! Looking at it, I have several thoughts to kick-off the conversation with:
|
Just fyi, in Actor Whitepaper and SDK/clients, we took care to use consistent naming for "runs", "call", "start" etc. It's important for CLI to be consistent with this too. |
No plans to remove any commands, max re-organize existing ones and add missing ones. Not sure if it makes sense to have a
When it comes to actors, everything is on platform except
Both of this still have the issue of "where does this run".
+1 to build namespace, definitely if we want to cover the versioning actor part of our api. But attach/ssh are features that the platform (to my knowledge) don't have right now, and that I doubt will come... At max, maybe we should have a command that simulates an actor build locally? (so all the steps the platform would do to build an image), but that requires extra setup from users (Docker, etc). |
Touché, but I'll let it slip for now 😄
That's true - my motivation behind It also made me think - It's a real pickle, but I still think that
We'll need to support
Sounds good to me, one small thing - if the build fails (even in Docker), you cannot really attach to anything, right? Having some sort of |
I suppose |
For reference, working document is now at https://www.notion.so/apify/New-CLI-Design-a8751a53896e472a9c8f474669f6f5d5 |
Closing, because this proposal has been resolved by the internal CLI Design Final Draft and broken down into sever Epics so far: |
The current state of the Apify CLI API is dubious. As a user, I’m always doubting the difference between
apify run
andapify call
, whetherapify create
does something locally or remotely, why doesapify actor:get-input
exist… etc.I also like to think about things in hierarchies. For any system with more than 3 features, hierarchy is imo everything. Even Apify (Console) has it - there are separate tabs for Actors, Tasks, Proxy settings, Storages etc.
The current CLI API doesn’t really reflect this.
If you look at any other CLI tool that works with similar resources, they are miles ahead - see
docker
/podman
, AWS CLI etc.Some (incomplete) examples / ideas:
apify actor info
.actor
file and logs infoapify actor create --template=[] [name]
apify actor init [name]
actor init
nowapify actor push
apify actor pull
apify actor run [--remote] [--input=INPUT.JSON] [actor id]
run
andcall
combined (switch with the--remote
flag or by setting theactor_id
)apify actor ls
apify actor rm [actor id]
apify actor build [actor id]
apify task ls
apify task rm [actor id]
apify task schedule [task id] [cron string]
apify task create
/add
/ …?apify run ls [--active|finished|aborted|...] [--actor-id=id]
apify run rm [run id]
apify run attach [run id]
stdout
to the users terminal, I don't think we can dostdin
. Still, it would be cool!apify run resurrect [run id]
apify run abort [run id]
apify run abort $(apify run ls --active -q)
?apify kvs create [name]
apify kvs ls
apify kvs ls [kvs id]
apify kvs rm [name]
apify kvs rename [name]
apify kvs set [--bucket-id=ID] --key=[KEY] value
put-object
actor:get-input
apify kvs get [--bucket-id=ID] --key=[KEY]
get-object
apify dataset create / ls / rm / rename
apify dataset get [--limit] [--offset] [--format=(json|csv|xml|...)] [dataset-id]
apify dataset push [--dataset-id=[id]] value
IMO this would send the CLI usability through the roof, inviting actual power users to use us through the command line. Also, most of the commands would just be straight API calls (and none of them clash with the current ones, so no breaking changes, only deprecating the old commands).
CC @B4nan @jancurn @vladfrangu what do you think?
The text was updated successfully, but these errors were encountered: