Skip to main content
In this guide you’ll learn how to create an Argo CD application entirely from the command line and synchronize it to a Kubernetes cluster using the argocd CLI. Follow these steps:
  • Install the argocd CLI
  • Authenticate (log in) to your Argo CD server
  • List existing applications
  • Create a new application with the CLI
  • Create the target namespace (if necessary)
  • Synchronize the application and verify status
For background reading, see the Argo CD documentation: Argo CD Docs and the Kubernetes docs: Kubernetes Concepts.

1. Install the argocd CLI

Choose the installation method that matches your OS. The following table summarizes common options. Example direct download (Linux amd64):
To install a specific release, replace latest with the release tag:
Verify the client version:
Example client-only output:
A dark-themed Visual Studio Code window with the integrated terminal displaying the Argo CD CLI help output (a list of available commands and flags). The Explorer sidebar is visible on the left and a faint Argo CD/VS Code logo appears in the editor area.
If the CLI cannot reach the Argo CD API server, commands that contact the server (e.g., argocd app list) will return a connection error. You must log in before managing applications.

2. Log in to the Argo CD server

First, try listing applications. If you’re not logged in or the CLI can’t reach the server, this will fail:
If you get an error such as “Failed to establish connection … connection refused”, confirm the argocd-server service and its NodePort or load balancer address. Find the argocd server service in the argocd namespace:
Note the NodePort (example: 31148) or external IP. Then log in with the CLI, replacing <NODEPORT> with the correct host:port (e.g., localhost:31148):
The login flow may prompt:
  • A TLS certificate verification warning (if the server uses a self-signed cert)
  • Username (commonly admin unless changed)
  • Password
If the server uses a self-signed certificate, argocd will warn that the certificate is signed by an unknown authority. You can proceed insecurely by answering y to the prompt, but for production environments configure TLS correctly to avoid security risks.
On successful login you should see:
Now retry:
Example output for one existing app:

3. Create a new application using the CLI

Create a new application (app-2) that points to the same repository and path as the existing app but targets a different namespace (app-2):
Expected response:
List applications again:
Because the repository path is shared with another application, Argo CD may report shared resources and mark the new app as OutOfSync. Example output:

4. Create the destination namespace (if needed)

If the destination namespace app-2 does not exist, create it with kubectl:

5. Synchronize the application

Sync the newly created application to apply the manifests to the cluster:
During sync the CLI prints resource-level events and a summary. Example output:
After the sync completes the application should appear as Synced / Healthy. Verify via the UI or with:

Troubleshooting and best practices

  • Use unique resource names and namespaces when multiple Argo CD applications reference the same repository to avoid SharedResourceWarning.
  • Prefer overlays, separate paths, or separate repositories when deploying distinct environments.
  • For production, configure proper TLS certificates rather than accepting self-signed certificates.
If multiple Argo CD applications point to the same manifests and overlap resources (same names/namespaces), Argo CD raises SharedResourceWarning. Avoid conflicts by using distinct repository paths, kustomize overlays, or separate namespaces and repositories.
This completes the demo for creating and synchronizing an Argo CD application using the CLI. For more examples and advanced workflows, see the Argo CD CLI reference.

Watch Video