cli: Failing context operations like add, use, list, etc.

Context operations do not work even after initializing context

How to Reproduce

Create an empty directory, and spin up a sample asyncapi spec document. for this I used the sample mentioned in the docs :

asyncapi config context init you should see a .asyncapi-cli file get created with the following content:

{"store":{}}

now running asyncapi config context add foo ./asyncapi.yaml gives the following message even if context is initialized already

You have no context file configured. Run "asyncapi config context init" to initialize it.

Expected behavior

  • Context should be added to the .asyncapi-cli file

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

I have narrowed the search for this bug. The bug is not reproduced when file oclif.manifest.json is removed from prebuilt @asyncapi/cli package. When cli package is built locally it does not include oclif.manifest.json file, that is why the bug is not reproduced when using the locally built package.

getting the same with binary installed over npm:

$ asyncapi --version
@asyncapi/cli/0.52.3 darwin-x64 node-v16.13.0

$ asyncapi config context init
Initialized context /{...}/template-for-generator-templates-asyncapi-fork/.asyncapi-cli

$ cat .asyncapi-cli
{"store":{}}

$ asyncapi config context add dummy test/fixtures/dummy.yml
You have no context file configured. Run "asyncapi config context init" to initialize it.