Skip to content

Commit

Permalink
Implement cli 'whoami' command
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed Feb 4, 2022
1 parent 62914c8 commit 8a1feb8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cli/src/commands/posts/post.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { service } from '@bluesky-demo/common'
import * as ucan from 'ucans'
import cmd from '../../lib/command.js'
import { Repo } from '../../lib/repo.js'
import { REPO_PATH } from '../../lib/env.js'
Expand Down
1 change: 0 additions & 1 deletion cli/src/commands/social/list-follows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { service } from '@bluesky-demo/common'
import cmd from '../../lib/command.js'
import { Repo } from '../../lib/repo.js'
import { REPO_PATH } from '../../lib/env.js'
Expand Down
8 changes: 7 additions & 1 deletion cli/src/commands/social/whoami.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import chalk from 'chalk'
import cmd from '../../lib/command.js'
import { Repo } from '../../lib/repo.js'
import { REPO_PATH } from '../../lib/env.js'

export default cmd({
name: 'whoami',
Expand All @@ -7,6 +10,9 @@ export default cmd({
args: [],
opts: [],
async command (args) {
throw new Error('TODO')
const repo = await Repo.load(REPO_PATH)
const store = await repo.getLocalUserStore()
console.log(`${repo.account.name} ${chalk.gray(repo.account.did)}`)
console.log(`${store.posts.length} posts | ${store.follows.length} followed`) // @TODO follower count
}
})

0 comments on commit 8a1feb8

Please sign in to comment.