N8n cli only package

I would like to be able to interact with n8n via API using the CLI. I can’t seem to find any cli-only package that I can install on my MacOs tnat would allow me to talk with a remote n8n API.

I checked the docs, npm site and brew search.

Would it make sense to extract a package like this? (happy to contibute!)

hello @rantoniuk

n8n is an UI-based tool. What are you trying to achieve? It’s even near impossible to build workflows without the UI.

You can use the API with the bare curl without any difficulties

n8n is the server. I’m talking about the client to talk with the (remote) server and the n8n local command is the interface that talks with that API instead of using curl and parameters to it.

This is a standard practice, take a look at Github API and the GH CLI tool to interface with it.

I don’t think it’s possible to do with n8n. The API there is very specific and there is no significant improvement in implementing a CLI wrapper for it.

I can’t imagine any use cases where it will be useful because you can automate anything you want within the workflows. There is no need to call the CLI at all. Moreover, you don’t have access to it on the cloud instance.

I can’t imagine any use cases where it will be useful because you can automate anything you want within the workflows. There is no need to call the CLI at all. Moreover, you don’t have access to it on the cloud instance.

There are plenty usecases. Any method that is in the API is a usecase:

  • list workflows
  • trigger a workflow from the command line
  • show last workflow status

etc.

Moreover, you don’t have access to it on the cloud instance.

I don’t have access to API? Of course I do: n8n public REST API Documentation and Guides | n8n Docs

But this question is actually originally about self-hosted instances for which I can expose the API however I imagine.

1 Like

You can export workflows to see them (it’s pretty the same output, as you get via API). But what is the use case? What are you going to do with the list?

No way. It’s not possible to run a workflow via API/CLI. Only via UI. However, you can enable/disable workflows via APi/CLI, but that’s a very rare scenario when you need to disable a workflow which raises OOM or any issue that prevents access to the UI.

You don’t have access to the CLI on cloud.

Anyway, you can submit a feature request here

1 Like

I think I don’t need to, since this is already supported - the question is why is that CLI not public.

n8n Plans and Pricing - n8n.io - search for CLI.

Can’t say what it is, maybe something related to the CI/CD

No need to theoretize, it’s written in the description:

E.g. create workflows automatically from the command line, and fit n8n into your infrastructure-as-code setup

so exactly what I was asking about.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.