Skip to content

Allow ntk to read the API key from an environment variable #30

Description

@next-devin

What happens now

ntk reads the API key from --apikey or config.yml.

The init and checkout commands can save a supplied API key to config.yml. Other commands do not rewrite the file.

There is no way for CI jobs or agents to provide the key through an environment variable without putting it in the command or configuration file.

What should happen

Allow the API key to be supplied through NTK_APIKEY.

Use this order:

  1. --apikey
  2. NTK_APIKEY
  3. config.yml

If the key came from NTK_APIKEY, ntk must not copy it into config.yml.

The existing behavior for an explicitly supplied --apikey can remain unchanged.

How to verify

  • Run a command with only NTK_APIKEY set. It should authenticate without asking for --apikey.
  • Run init or checkout using NTK_APIKEY. The environment value should not appear in config.yml.
  • Supply both --apikey and NTK_APIKEY. The command-line value should be used.
  • Run without either value. ntk should continue to read the key from config.yml.

Done when

  • All ntk commands can use NTK_APIKEY.
  • Environment-supplied keys are never written to config.yml.
  • Command-line values take priority over environment values.
  • Existing config.yml behavior continues to work.
  • Tests cover the three possible sources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions