The `influx` command line interface (CLI) provides an interactive shell for the HTTP API associated with `influxd`.
Use `influx` to write data (manually or from a file), query data interactively, view query output in different formats, and manage resources in InfluxDB.
The following environment variables can be used to configure settings used by the `influx` client. They can be specified in lower or upper case, however the upper case version takes precedence.
#### `HTTP_PROXY`
Defines the proxy server to use for HTTP.
**Value format:**`[protocol://]<host>[:port]`
```
HTTP_PROXY=http://localhost:1234
```
#### `HTTPS_PROXY`
Defines the proxy server to use for HTTPS. Takes precedence over HTTP_PROXY for HTTPS.
**Value format:**`[protocol://]<host>[:port]`
```
HTTPS_PROXY=https://localhost:1443
```
#### `NO_PROXY`
List of host names that should **not** go through any proxy. If set to an asterisk '\*' only, it matches all hosts.
By default, pps is zero and influx will not throttle importing.
Use with `-import`.
`-precision 'rfc3339|h|m|s|ms|u|ns'`
Specifies the format/precision of the timestamp: `rfc3339` (`YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ`), `h` (hours), `m` (minutes), `s` (seconds), `ms` (milliseconds), `u` (microseconds), `ns` (nanoseconds).
Precision defaults to nanoseconds.
> **Note:** Setting the precision to `rfc3339` (`-precision rfc3339`) works with the `-execute` option, but it does not work with the `-import option`. All other precision formats (e.g., `h`,`m`,`s`,`ms`,`u`, and `ns`) work with the `-execute` and `-import` options.
`-pretty`
Turns on pretty print for the `json` format.
`-ssl`
Use HTTPS for requests.
`-unsafeSsl`
Disables SSL certificate verification.
Use when connecting over HTTPS with a self-signed certificate.
`-username 'username'`
The username that `influx` uses to connect to the server.
Alternatively, set the username for the CLI with the `INFLUX_USERNAME` environment variable.
- _Optional_: **DDL (Data Definition Language)**: Contains the [InfluxQL commands](/enterprise_influxdb/v1/query_language/manage-database/) for creating the relevant [database](/enterprise_influxdb/v1/concepts/glossary/) and managing the [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
- **DML (Data Manipulation Language)**: Context metadata that specifies the database and (if desired) retention policy for the import and contains the data in [line protocol](/enterprise_influxdb/v1/concepts/glossary/#influxdb-line-protocol).
- To throttle the import, use `-pps` to set the number of points per second to ingest. By default, pps is zero and `influx` does not throttle importing.
- To import a file compressed with `gzip` (GNU zip), include the -compressed flag.
- Include timestamps in the data file.
If points don’t include a timestamp, InfluxDB assigns the same timestamp to those points, which can result in unintended [duplicate points or overwrites](/enterprise_influxdb/v1/troubleshooting/frequently-asked-questions/#how-does-influxdb-handle-duplicate-points).
- If your data file contains more than 5,000 points, consider splitting it into smaller files to write data to InfluxDB in batches.
We recommend writing points in batches of 5,000 to 10,000 for optimal performance.
Writing smaller batches increases the number of HTTP requests, which can negatively impact performance.
By default, the HTTP request times out after five seconds. Although InfluxDB continues attempting to write the points after a timeout, you won’t receive confirmation of a successful write.
> **Note:** To export data from InfluxDB version 0.8.9, see [Exporting from 0.8.9](https://github.com/influxdb/influxdb/blob/1.8/importer/README.md).
Clears the current context for the [database](/enterprise_influxdb/v1/concepts/glossary/#database) or [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
Specifies the format/precision of the timestamp: `rfc3339` (`YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ`), `h` (hours), `m` (minutes), `s` (seconds), `ms` (milliseconds), `u` (microseconds), `ns` (nanoseconds).
Precision defaults to nanoseconds.
`pretty`
Turns on pretty print for the `json` format.
`settings`
Outputs the current settings for the shell including the `Host`, `Username`, `Database`, `Retention Policy`, `Pretty` status, `Chunked` status, `Chunk Size`, `Format`, and `Write Consistency`.
Sets the current [database](/enterprise_influxdb/v1/concepts/glossary/#database) and/or [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
Enter `insert` followed by the data in [line protocol](/enterprise_influxdb/v1/concepts/glossary/#influxdb-line-protocol) to write data to InfluxDB.
Use `insert into <retention policy> <line protocol>` to write data to a specific [retention policy](/enterprise_influxdb/v1/concepts/glossary/#retention-policy-rp).
See [Data exploration](/enterprise_influxdb/v1/query_language/explore-data/), [Schema exploration](/enterprise_influxdb/v1/query_language/explore-schema/), [Database management](/enterprise_influxdb/v1/query_language/manage-database/), [Authentication and authorization](/enterprise_influxdb/v1/administration/authentication_and_authorization/) for InfluxQL documentation.