Skip to content

Add nx routes: list every route and the file that answers it #455

Done

Description

@Espoir-Loem

What happens

There is no way to list the routes of a project from the terminal. To know which URL a file answers, or which file answers a URL, you open /docs in a browser (on the dev server only) or the dev toolbar.

Other frameworks have a command for it:

  • Rails: bin/rails routes
  • Laravel: php artisan route:list
  • Litestar: litestar routes

Proposal

Add nx routes, which builds the application the way nx start does and prints one line per route:

GET          /                  src/routes/index.nexy
GET          /users/{id}        src/routes/users/[id].nexy
GET POST     /api/users         src/routes/api/users.py
WS           /chat              src/routes/chat.py
  • The data already exists: routes_of() in nexy/helpers/server/devtools/state.py gives the path, the methods and the source file of each route, for the toolbar. Reuse it, do not copy it.
  • Sort the lines by path, and leave out Nexy's own routes (routes_of already does).
  • A new file nexy/modules/cli/commands/routes.py, listed in _COMMANDS of nexy/modules/cli/__init__.py; strings through t() and nexy/modules/i18n/en.json.

Done when

  • nx routes prints every route of a file-based project and of a modular one.
  • A test builds a small project with a page, an API file and a dynamic route, and checks the lines.

Getting started

Read tests/unit/nexy/routers/test_health.py (class TestAssembledApp) to see how a test builds a real application from a temporary project. Comment here before you start.

Activity

  1. added
    good first issue
    area:cli
    priority:3
    on Nov 19, 2026
  2. removed their assignment
    on Nov 19, 2026
  3. added
    difficulty:intermediate
    on Nov 19, 2026
  4. WinnrDz commented on Nov 19, 2026

    @WinnrDz
    Contributor

    Hi, I'm gonna to try to work on this issue, i will try to test a small page first with routes, and i will see how to build the routes command

  5. Espoir-Loem commented on Nov 19, 2026

    @Espoir-Loem
    MemberAuthor

    Thanks @WinnrDz, #455 is yours!

    To get started:

    1. Fork the repository, then follow the Quick start of CONTRIBUTING.md: it installs everything and runs the checks in about two minutes.
    2. Read the issue again: it names the files to start from and what "done" means.
    3. Open a draft pull request against develop early, even a small one, and ask here whenever something is unclear.
    4. No news for 14 days frees the issue for someone else, with no hard feelings: a comment or a draft pull request keeps it yours, and /take brings it back.

    Nexy is a young project, and its community is how it grows. If you like what you see:

    None of this is required to contribute: your pull request is what counts. Welcome aboard!

  6. moved this from Next to Now in Nexy roadmapon Nov 19, 2026
  7. github-actions commented on Nov 19, 2026

    @github-actions
    Contributor

    Thanks @WinnrDz, #455 is yours!

    To get started:

    1. Fork the repository, then follow the Quick start of CONTRIBUTING.md: it installs everything and runs the checks in about two minutes.
    2. Read the issue again: it names the files to start from and what "done" means.
    3. Open a draft pull request against develop early, even a small one, and ask here whenever something is unclear.
    4. No news for 14 days frees the issue for someone else, with no hard feelings: a comment or a draft pull request keeps it yours, and /take brings it back.

    Nexy is a young project, and its community is how it grows. If you like what you see:

    None of this is required to contribute: your pull request is what counts. Welcome aboard!

  8. WinnrDz commented on Nov 20, 2026

    @WinnrDz
    Contributor

    update : I went through CONTRIBUTING.md, i ran the tests and think im good to start developing, I have created a small test page following the command "nx --help" ,I am relatively new to cli commands and i will try my best

    image
  9. Espoir-Loem commented on Nov 20, 2026

    @Espoir-Loem
    MemberAuthor

    Hi @WinnrDz, good to see you moving on this. Here is a concrete path for #455, with the links you need.

    You do not need extra documentation to start: the issue already names the files. You do need two pages before you finish, because the checks in this repository will fail without them. I put them at the end.

    1. Work on a branch, not on develop. Follow the Quick start of CONTRIBUTING.md, then git checkout -b feature/nx-routes.

    2. Write the test first. tests/unit/nexy/routers/test_health.py, class TestAssembledApp, shows how to build a real application from a temporary project. Use the same pattern with a page, an API file and a dynamic route, then check the printed lines: one line per route, sorted by path, with the methods and the source file.

    3. Add nexy/modules/cli/commands/routes.py. Reuse routes_of() from nexy/helpers/server/devtools/state.py. It already leaves out Nexy's own routes, so do not filter them again. nexy/modules/cli/commands/start.py shows how nx start assembles the application, so the command sees the same routes.

    4. Register the function in _COMMANDS in nexy/modules/cli/init.py. This is what makes nx routes exist.

    5. Put every string behind t(). Then add the new keys to all twelve catalogs in nexy/modules/i18n, not only to en.json. The English default in the code must match en.json exactly. tests/unit/nexy/i18n/test_cli_catalogs.py checks this and gives 12 failures if one catalog is missing the keys. This is the same problem another PR is fixing right now, so it is worth doing once, directly.

    6. Update docs/reference/cli.md: add nx routes to the Commands table and one short description. Add one line to CHANGELOG.md. Do not edit the translated pages under docs/<code>/; they are generated by python scripts/translate_docs.py --lang <code> (script).

    7. Run python scripts/verify.py before you push. It runs the same gates as CI. Open a draft pull request against develop early, even if the command is not finished yet, and ask here whenever something is unclear.

    The documentation you actually need:

    Take it in that order, and send a draft PR as soon as the test is red and the command starts to take shape. I will review it with you.

  10. Espoir-Loem commented on Nov 24, 2026

    @Espoir-Loem
    MemberAuthor

    Implemented by #590 and merged to develop as 88b2183. nx routes lists application routes with their HTTP methods, paths and source files, sorted by path, and skips framework routes. When no application route exists, it prints No routes found..

    Thank you @WinnrDz for the work and for staying with the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:clidifficulty:intermediategood first issuepriority:3

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions