pieces-app / cli-agent

Pieces CLI for interacting with Pieces OS
https://docs.pieces.app/extensions-plugins/cli
MIT License
50 stars 19 forks source link

Null check operator used on a null value #87

Closed joshuadanpeterson closed 4 months ago

joshuadanpeterson commented 4 months ago

When I try to run any command or subcommand I get this error

` Unhandled exception: Null check operator used on a null value

0 Application.fromJson (package:runtime_common_library/model/application.dart:111)

1 Format.fromJson (package:runtime_common_library/model/format.dart:281)

2 Format.listFromJson (package:runtime_common_library/model/format.dart:304)

3 AssetFormats.fromJson (package:runtime_common_library/model/asset_formats.dart:83)

4 Asset.fromJson (package:runtime_common_library/model/asset.dart:305)

5 Asset.listFromJson (package:runtime_common_library/model/asset.dart:326)

6 Assets.fromJson (package:runtime_common_library/model/assets.dart:76)

7 Cacher.cache (package:pieces_cli/src/util/cacher.dart:86)

#8 _initChecks (file:///Users/runner/work/pieces-cli/pieces-cli/bin/main.dart:109) #9 main (file:///Users/runner/work/pieces-cli/pieces-cli/bin/main.dart:27) ` Also, typing -h works, but --help doesn't
BishoyHanyRaafat commented 4 months ago

How did u install pieces-cli??

joshuadanpeterson commented 4 months ago

With Homebrew

BishoyHanyRaafat commented 4 months ago

Homebrew is using the old version of the cli agent and it does not work so you can use this github until we ship it

joshuadanpeterson commented 4 months ago

Got it. Thanks, that makes sense now.

How do I use the GitHub version? Just clone the repo?

BishoyHanyRaafat commented 4 months ago

Do you have python??

joshuadanpeterson commented 4 months ago

Yes, of course, isn't that what this cli is coded with?

BishoyHanyRaafat commented 4 months ago

Perfect!

  1. Clone the repo on your machine
  2. Go to the project cloned directory
  3. Do pip install .

You can also check the releases but it is a bit outdated too that is the recommended way for now until we update everything

joshuadanpeterson commented 4 months ago

Uninstalled the homebrew version, cloned the repo and ran the install, and now I'm getting this error:

Traceback (most recent call last): File "/Users/joshpeterson/.pyenv/versions/3.11.4/bin/pieces", line 5, in <module> from pieces.app import main File "/Users/joshpeterson/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pieces/app.py", line 2, in <module> from pieces.commands import * File "/Users/joshpeterson/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pieces/commands/__init__.py", line 7, in <module> from .assets import (update_asset_value, File "/Users/joshpeterson/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pieces/commands/assets.py", line 85 file_path = os.path.join(open_snippet_dir , f"{commands_functions.sanitize_filename(asset["name"])}{commands_functions.get_file_extension(asset["language"])}") ^^^^ SyntaxError: f-string: unmatched '['

BishoyHanyRaafat commented 4 months ago

Interesting so basically because I use python 3.12 that's why I did not see this error it is a small fix I will create a PR to solve that issue.

joshuadanpeterson commented 4 months ago

Cool, thank you

BishoyHanyRaafat commented 4 months ago

Yup merged

joshuadanpeterson commented 4 months ago

Cool thank you. It works. Now it's just slow to execute lol

BishoyHanyRaafat commented 4 months ago

Use pieces run

mark-at-pieces commented 4 months ago

Cool thank you. It works. Now it's just slow to execute lol

how many Pieces do you have saved?

mark-at-pieces commented 4 months ago

very well could be some performance issues, that we can take a look into @BishoyHanyRaafat

lemme know if you want to an eval on performance with myself and @caleb-at-pieces

BishoyHanyRaafat commented 4 months ago

Okay next task is to make the cli agent to run faster plus I wanted to handle the errors better

joshuadanpeterson commented 4 months ago

Cool thank you. It works. Now it's just slow to execute lol

how many Pieces do you have saved?

Currently, 201

BishoyHanyRaafat commented 4 months ago

Cool thank you. It works. Now it's just slow to execute lol

how many Pieces do you have saved?

Currently, 201

Currently we are working on make the list command much much fast no worries when the update comes I will mention you

joshuadanpeterson commented 4 months ago

@BishoyHanyRaafat Cool, thank you

Bishoy-at-pieces commented 4 months ago

@joshuadanpeterson let me know how it is now. It is a bit slow but it is much much faster And I recommend using the run command The project is now on pypi pip install pieces-cli

joshuadanpeterson commented 4 months ago

@joshuadanpeterson let me know how it is now. It is a bit slow but it is much much faster And I recommend using the run command The project is now on pypi pip install pieces-cli

Cool, thank you @Bishoy-at-pieces. It's much much faster

Bishoy-at-pieces commented 4 months ago

Next release it will be faster by 2 more sec most probably

Bishoy-at-pieces commented 4 months ago

You mind closing that issue?

joshuadanpeterson commented 4 months ago

Closing