Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c8cc8cf
:heavy_plus_sign: add noneprompt as dependency
NCBM Jul 4, 2025
a8064e9
:sparkles: introduce preliminary cache support
NCBM Jul 5, 2025
75f8925
:globe_with_meridians: add message translation for invalid cache
NCBM Jul 5, 2025
f7c4d8b
:bug: fix a TYPE_CHECKING condition
NCBM Jul 6, 2025
c85b6e4
:recycle: rename `ignore_mtime` parameter as `allow_expired` for loca…
NCBM Jul 6, 2025
31ed2b4
:bug: fix cache saving since it's async
NCBM Jul 6, 2025
568f0fa
:sparkles: add user warnings for outdated and not-writable caches
NCBM Jul 6, 2025
331f77d
:globe_with_meridians: add translations for cache warnings
NCBM Jul 6, 2025
1e6979b
:recycle: use nonestorage for getting program data directories
NCBM Jul 7, 2025
02ed2ad
:recycle: use cache dir from internal data module
NCBM Jul 7, 2025
bf4168e
:bug: warn when failed to mkdir cache dir
NCBM Jul 7, 2025
081b865
:globe_with_meridians: update translations for new messages
NCBM Jul 7, 2025
865e769
:recycle: rename `ModuleClass` as `module_class` for consistency
NCBM Jul 7, 2025
96eb39f
:sparkles: add support for cherry-picking unpublished modules
NCBM Jul 7, 2025
0d12cbd
:globe_with_meridians: update new message translations
NCBM Jul 7, 2025
a3378f4
:sparkles: add cli functions to display cache size and update cache
NCBM Jul 7, 2025
d59456a
:beers: change words in the help of cache status
NCBM Jul 7, 2025
dea168e
:globe_with_meridians: add new translations for cli functions
NCBM Jul 7, 2025
220af3c
:sparkles: show cache location when showing status
NCBM Jul 7, 2025
37750b0
:sparkles: add `--si` option to cli cache status
NCBM Jul 7, 2025
a3f7e19
:recycle: refactor cache update cli interaction
NCBM Jul 9, 2025
e87a4d2
:sparkles: add cli functions to clear caches
NCBM Jul 9, 2025
8d85b06
:globe_with_meridians: add new translations for cache clearing
NCBM Jul 9, 2025
375e19a
:sparkles: add more module model fields
NCBM Jul 17, 2025
ca33bf4
:sparkles: add dynamic project dependency generation logic for projec…
NCBM Jul 17, 2025
79d6fd0
:recycle: refactor ConfigManager to support both new and old format
NCBM Jul 19, 2025
5230c0a
:bug: fix configuration template with adapters in the same module
NCBM Jul 19, 2025
5012dcf
:sparkles: add smart uninstalling for new format
NCBM Jul 19, 2025
c2e32f1
:sparkles: add full capability of dependency management
NCBM Jul 19, 2025
d017b4e
:sparkles: add batch operations for config management
NCBM Jul 20, 2025
52b431d
:sparkles: add function handlers for project format operations
NCBM Jul 20, 2025
6642244
:bug: write inline adapter info when up/downgrading
NCBM Jul 20, 2025
fdf89b6
:bug: add '-' and '_' as valid package name chars
NCBM Jul 20, 2025
24fae8a
:bug: fix possible out-of-index error when handling dependency
NCBM Jul 20, 2025
31e2e5f
:bug: add nonebot2 dependency correctly
NCBM Jul 20, 2025
acfe0c4
:sparkles: add CLI interface for up/downgrading project format
NCBM Jul 20, 2025
7c1a71b
:sparkles: add localstore configrations when creating bot
NCBM Jul 20, 2025
82c8ff8
:loud_sound: update error message when installing adapters and plugins
NCBM Jul 20, 2025
c7a1bf6
:globe_with_meridians: add new translations
NCBM Jul 20, 2025
b7712ae
:pencil2: fix docstring format
NCBM Jul 20, 2025
16cb97a
:sparkles: add continuous operation streams in CLI
NCBM Jul 21, 2025
c98277c
:globe_with_meridians: add new CLI flow message
NCBM Jul 21, 2025
2e85801
:see_no_evil: update template not-to-ignore pattern
NCBM Jul 27, 2025
b3f4771
:sparkles: add developer tools choices in 'simple' template
NCBM Jul 27, 2025
148e66a
:sparkles: allow list_xxx to get unpublished modules
NCBM Aug 5, 2025
5129254
:children_crossing: improve control flow in CLI
NCBM Aug 5, 2025
40c900c
:sparkles: cache cleaning supports cleaning runtime cache
NCBM Aug 5, 2025
c7ac012
:sparkles: add add unpublished modules to caching
NCBM Aug 5, 2025
2aeee8d
:sparkles: add initial support for accessing unpublished adapters
NCBM Aug 5, 2025
f10dc6b
:sparkles: add dev dependencies, more ruff rules and better extension…
NCBM Aug 5, 2025
d36e72e
:bug: fix wrong behaviour when adding/updating/removing dependencies
NCBM Aug 8, 2025
329c653
:bug: fix incorrect warning message color
NCBM Aug 8, 2025
8135895
:sparkles: add full support for unpublished modules
NCBM Aug 9, 2025
b399105
:children_crossing: add more messages and fix control flow
NCBM Aug 9, 2025
e88bd56
:globe_with_meridians: add and update translation messages
NCBM Aug 9, 2025
52845b1
:bug: remove redundant `name` attribute of subclasses of `SimpleInfo`
NCBM Aug 9, 2025
b1d98c8
:heavy_plus_sign: add `rich` as dependency
NCBM Aug 9, 2025
5fd9c4f
:recycle: move functions for output formatting to `nb_cli.cli.utils`
NCBM Aug 9, 2025
3102515
:bug: add `skip_test` for `Plugin` data model
NCBM Aug 10, 2025
3f3c8e4
:heavy_plus_sign: add `textual` as dependency
NCBM Aug 10, 2025
97a4f22
:heavy_plus_sign: add utility functions for filtering, layout and col…
NCBM Sep 22, 2025
8c65e75
:heavy_plus_sign: add gallery interface and basic cards
NCBM Sep 22, 2025
0f62d38
:children_crossing: add debounce on searching in gallery
NCBM Sep 23, 2025
6273202
:bug: fix text cutting width and display error from wrong data
NCBM Sep 23, 2025
d4b6ae2
:sparkles: add modal card popup
NCBM Sep 23, 2025
dfdc85c
:globe_with_meridians: make toggle dark mode translatable
NCBM Sep 23, 2025
9fd6c95
:sparkles: add tui entries in cli
NCBM Sep 23, 2025
fefaca7
:globe_with_meridians: update translations
NCBM Sep 23, 2025
e7b6e33
:children_crossing: optimize advanced search filter and improve filte…
NCBM Oct 6, 2025
3430252
:rotating_light: remove duplicate keywords in pyproject.toml
NCBM Oct 7, 2025
371aa42
:arrow_up: upgrade noneprompt to 0.1.10
NCBM Oct 7, 2025
671d2fc
:sparkles: allow interactive package finder to use advanced search fi…
NCBM Oct 7, 2025
9925add
:bug: fix adapter/plugin configuration procedure
NCBM Oct 7, 2025
8a89663
:technologist: add `as_dependency` shortcut for package component
NCBM Oct 7, 2025
7168c44
:sparkles: allow running subprocesses with custom environment variables
NCBM Oct 7, 2025
d9a15f8
:sparkles: add LogConsole for process output handling and integrate w…
NCBM Oct 7, 2025
e426fc1
:globe_with_meridians: update new translations
NCBM Oct 7, 2025
fdd2cff
:bug: fix incorrect hint for closing console
NCBM Oct 7, 2025
14ae792
:sparkles: allow copy contents in console
NCBM Oct 7, 2025
a11dcd8
:sparkles: add docs for advanced searching
NCBM Oct 7, 2025
6a0efc4
:bug: fix adding duplicate plugin module in default config policy
NCBM Oct 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ docs_build/_build
.docusaurus
website/docs/api/**/*.md
website/static/packages/*.whl
!nb_cli/project/{{cookiecutter.project_slug}}/.env
!nb_cli/template/project/*/{{cookiecutter.computed.project_slug}}/.env*
!nb_cli/template/project/simple/{{cookiecutter.computed.project_slug}}/.vscode

# Created by https://www.toptal.com/developers/gitignore/api/node,macos,linux,python,windows,jetbrains,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,linux,python,windows,jetbrains,visualstudiocode
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ repos:
- id: prettier
types_or: [javascript, jsx, ts, tsx, markdown, yaml, json]
stages: [pre-commit]
exclude: ^nb_cli/template/project/.*\.json$

- repo: https://github.com/nonebot/nonemoji
rev: v0.1.4
Expand Down
60 changes: 46 additions & 14 deletions nb_cli/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Optional, cast

import click
from noneprompt import Choice, ListPrompt, CancelledError
from noneprompt import Choice, ListPrompt, ConfirmPrompt, CancelledError

from nb_cli import _, __version__
from nb_cli.handlers import draw_logo
Expand All @@ -16,6 +16,22 @@
from .customize import ClickAliasedCommand as ClickAliasedCommand


@click.command # this command only appears in interactive mode.
@click.pass_context
@run_async
async def exit_(ctx: click.Context):
if await ConfirmPrompt(_("Are you sure to exit NB CLI?"), True).prompt_async(
style=CLI_DEFAULT_STYLE
):
ctx.exit()


@click.command # this command only appears in interactive mode.
def back_():
# nothing to do, just to keep a command to avoid type violation
return


def _set_global_working_dir(
ctx: click.Context, param: click.Option, value: Optional[Path]
):
Expand Down Expand Up @@ -93,28 +109,44 @@ async def cli(ctx: click.Context):
sub_cmd,
)
)
_exit_choice = Choice(_("Exit NB CLI."), exit_)
choices.append(_exit_choice)

click.secho(draw_logo(), fg="cyan", bold=True)
click.echo("\n\b")
click.secho(_("Welcome to NoneBot CLI!"), fg="green", bold=True)

# prompt user to choose
try:
result = await ListPrompt(
_("What do you want to do?"), choices=choices
).prompt_async(style=CLI_DEFAULT_STYLE)
except CancelledError:
ctx.exit()

sub_cmd = result.data
await run_sync(ctx.invoke)(sub_cmd)


from .commands import run, self, create, driver, plugin, adapter, generate
while True:
# prompt user to choose
try:
result = await ListPrompt(
_("What do you want to do?"), choices=choices
).prompt_async(style=CLI_DEFAULT_STYLE)
except CancelledError:
result = _exit_choice

sub_cmd = result.data
ctx.params["can_back_to_parent"] = True
await run_sync(ctx.invoke)(sub_cmd)


from .commands import (
run,
self,
create,
driver,
plugin,
adapter,
generate,
upgrade_format,
downgrade_format,
)

cli.add_command(create)
cli.add_command(run)
cli.add_command(generate)
cli.add_command(upgrade_format)
cli.add_command(downgrade_format)

cli.add_command(plugin)

Expand Down
2 changes: 2 additions & 0 deletions nb_cli/cli/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
from .project import create as create
from .adapter import adapter as adapter
from .project import generate as generate
from .project import upgrade_format as upgrade_format
from .project import downgrade_format as downgrade_format
Loading