Command Line Interface Overview
The tideways CLI simplifies tracing PHP console scripts and
HTTP API requests for you. You can prefix any php, curl, http (httpie)
or wget command you want to trace with tideways run <app> and it will set
local environment variables for a PHP script or arguments to send HTTP headers
with curl/wget.
Installation
| The tool is currently supported on both Linux and macOS. |
On servers or machines where the package repositories for Tideways are set up,
you can install the tideways CLI via a package manager.
apt-get install tideways-cli
dnf install tideways-cli
brew install tideways-cli
Setup
The easiest way to get started is running tideways init. It checks whether
settings have already been imported and, if not, asks for a CLI token and a
default project:
$ tideways init
tideways init is fully scriptable for non-interactive setups: every choice
it would otherwise prompt for is also available as a flag or environment
variable.
|
CLI token to import settings with. Falls back to |
|
Default Tideways project to configure. Falls back to |
|
Tideways endpoint to import data from. (default |
|
Select a new default Tideways project. |
$ tideways init --api-token=$TIDEWAYS_INIT_API_TOKEN --project=acme/myproject42
Alternatively you can import the settings for your account directly. Open
Commandline user settings
dialog and follow the instructions to call tideways import.
tideways import <copy your generated token here>
[OK] Imported Settings for Tideways CLI.
You can now start profiling with 'tideways run <args>'
Run tideways init again inside a project’s repository to associate that
directory with a Tideways project. Commands that accept a project_name
argument (such as project, service, transaction, error, non-fatal
and slow-sql) will no longer require said argument and will fall back to the repository’s
configured project, or otherwise the CLI’s global default project.
From here you can list your projects, inspect a project, start profiling, create events and tracepoints.
Installation via Docker
For some use cases, like CI/CD pipelines or certain dev setups, it might be useful to install the Tideways CLI via Docker.
To install the tideways CLI binary in your own container images you can
copy the standalone binary from the official ghcr.io/tideways/cli image.
COPY --from=ghcr.io/tideways/cli:latest /usr/bin/tideways /usr/bin/tideways
The image can also be used directly. A valid CLI token needs to be
available in the TIDEWAYS_CLI_TOKEN environment variable and exposed
to the container.
export TIDEWAYS_CLI_TOKEN=your_token
docker run -it --rm -e TIDEWAYS_CLI_TOKEN ghcr.io/tideways/cli list
| The docker image does not contain a PHP binary and does not have access to your application source code. Certain commands might not work as expected compared to a native installation on the host system. |