Skip to content

Conversation

2chanhaeng
Copy link
Contributor

Summary

Add webfinger command using Optique.

Related Issue

Changes

  • packages/cli/webfinger.ts

Benefits

Now Fedify 2.0 lookup webfinger using Optique

Checklist

  • Did you add a changelog entry to the CHANGES.md?
    I will add it after Migrate cli lookup from Cliffy to Optique  #390
  • Did you write some relevant docs about this change (if it's a new feature)?
  • Did you write a regression test to reproduce the bug (if it's a bug fix)?
  • Did you write some tests for this change (if it's a new feature)?
  • Did you run deno task test-all on your machine?

Additional Notes

Merge after #390

@github-actions github-actions bot added component/cli CLI tools related priority/high High priority issues runtime/bun Bun runtime related runtime/deno Deno runtime related runtime/node Node.js runtime related type/feature Requests for new features labels Sep 1, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @2chanhaeng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request overhauls the Fedify CLI's underlying command parsing and execution system by adopting the 'Optique' framework. This change streamlines how commands are defined and processed, improving maintainability and consistency. While introducing a new 'webfinger' command, it also involves a significant refactoring and simplification of existing features like the 'inbox' and 'nodeinfo' commands, with some previous interactive functionalities being removed or slated for future re-implementation under the new architecture. The update also adjusts the CLI's packaging, aligning it more closely with Deno-native development.

Highlights

  • CLI Framework Migration: The entire command-line interface framework has been migrated from 'cliffy' to 'Optique', leading to significant rewrites of command definitions and argument parsing logic across 'init', 'lookup', 'inbox', 'nodeinfo', 'tunnel', and 'webfinger' commands.
  • WebFinger Command Implementation: A new 'webfinger' command has been added, utilizing the 'Optique' framework for parsing arguments and 'Fedify's 'lookupWebFinger' utility to retrieve WebFinger resources.
  • Refactoring of 'inbox' and 'nodeinfo' commands: The 'inbox' command's previous interactive UI and detailed logging capabilities have been removed, with a basic 'Optique'-based placeholder introduced. The 'nodeinfo' command's interactive favicon display and ASCII art generation features have also been removed.
  • Dependency Overhaul: Numerous dependencies related to the old 'cliffy' framework, Hono, and specific UI/logging features have been removed. New dependencies for 'Optique' and updated versions of existing libraries (like 'jimp' and 'ora') have been introduced, along with a broader set of image processing libraries.
  • CLI Packaging Changes: The CLI's packaging strategy has been revised, removing Node.js-specific installation scripts and 'package.json' fields related to direct npm publishing, indicating a shift towards Deno-centric or internal distribution.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a major refactoring of the CLI, migrating from @cliffy/command to Optique. This is a great step forward, simplifying the command definitions and cleaning up dependencies. The addition of the webfinger command is also a welcome feature. I've identified a few issues, including a duplicate dependency, a potential race condition due to a missing await on an async function, and a resource leak in an error handling path. Addressing these will improve the robustness and maintainability of the new CLI implementation.

@dahlia
Copy link
Member

dahlia commented Sep 5, 2025

Could you rebase your own commits on the current next branch?

Copy link
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we can utilize Optique's rich message formatter.

@2chanhaeng
Copy link
Contributor Author

It would be great if we can utilize Optique's rich message formatter.

For that, we need a spinner library that can replace ora and work with optique.

@2chanhaeng
Copy link
Contributor Author

I applied @optique/core/message, but I'm worried if this is the usage you had in mind.😅

Copy link
Contributor

github-actions bot commented Sep 9, 2025

The docs for this pull request have been published:

https://81d5bb00.fedify.pages.dev

fedify-dev#401 (comment)

Co-authored-by: Hong Minhee (洪 民憙) <[email protected]>
Copy link
Contributor

github-actions bot commented Sep 9, 2025

The latest push to this pull request has been published to JSR and npm as a pre-release:

Package Version JSR npm
@fedify/fedify 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/cli 2.0.0-pr.401.1565+78a82f49 JSR
@fedify/amqp 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/cfworkers 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/denokv 2.0.0-pr.401.1565+78a82f49 JSR
@fedify/elysia 2.0.0-pr.401.1565+78a82f49 npm
@fedify/express 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/h3 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/hono 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/nestjs 2.0.0-pr.401.1565+78a82f49 npm
@fedify/next 2.0.0-pr.401.1565+78a82f49 npm
@fedify/postgres 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/redis 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/sqlite 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/sveltekit 2.0.0-pr.401.1565+78a82f49 JSR npm
@fedify/testing 2.0.0-pr.401.1565+78a82f49 JSR npm

@dahlia dahlia merged commit 4a3d567 into fedify-dev:next Sep 9, 2025
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cli CLI tools related priority/high High priority issues runtime/bun Bun runtime related runtime/deno Deno runtime related runtime/node Node.js runtime related type/feature Requests for new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants