There is no direct connection from Tunis to Tripoli. However, you can take the line 35 bus to Tunis airport, fly to Beirut, then take the drive to Tripoli. Alternatively, you can drive from Tunis to Tripoli in around 2 days 3 h.
How to get from Tunis to Tripoli
From Charguia line 35 bus to Tunis airport, fly to Beirut airport, then drive to Tripoli. 6 h 23 min $297. From Tunis drive to Tripoli. 2 days 3 h $333.